<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[RemoteXY community — edit library >>>>help]]></title>
		<link>https://forum.remotexy.com/viewtopic.php?id=843</link>
		<atom:link href="https://forum.remotexy.com/extern.php?action=feed&amp;tid=843&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in edit library >>>>help.]]></description>
		<lastBuildDate>Fri, 29 Nov 2019 22:41:24 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: edit library >>>>help]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=2457#p2457</link>
			<description><![CDATA[<p>thanks for your replay <br />actually i found another way to do what i need-control led on and off time with milis() by remotexy app-<br />but it almost done<br />i&#039;ll paste a link under the codes of the video about the problem</p><p>the codes are </p><br /><p>first one with arduino uno and 2 potentiometer<br /></p><div class="codebox"><pre><code>#include &lt;Wire.h&gt;
#include &lt;LiquidCrystal_I2C.h&gt;
LiquidCrystal_I2C lcd(0x27, 16, 2);

int ledPin =  8;      // the number of the LED pin
int ledState = LOW;             // ledState used to set the LED
unsigned long previousMillis = 0;        // will store last time LED was updated


void setup() {
  pinMode(A0, INPUT);
  pinMode(A1, INPUT);
  lcd.init();
  lcd.backlight();

}

void loop() {
  unsigned long currentMillis = millis();
  long OnTime = analogRead(A0);
  long OffTime = analogRead(A1);


  Serial.println(OnTime);
  Serial.println(OffTime);


  // check to see if it&#039;s time to change the state of the LED

  if ((ledState == HIGH) &amp;&amp; (currentMillis - previousMillis &gt;= OnTime))
  {
    ledState = LOW;  // Turn it off
    previousMillis = currentMillis;  // Remember the time
    digitalWrite(ledPin, ledState);  // Update the actual LED
  }

  else if ((ledState == LOW) &amp;&amp; (currentMillis - previousMillis &gt;= OffTime))
  {
    ledState = HIGH;  // turn it on
    previousMillis = currentMillis;   // Remember the time
    digitalWrite(ledPin, ledState);    // Update the actual LED
  }
lcd.setCursor(0,0);
  lcd.print(&quot;on time = &quot;);
    lcd.print(OnTime);



  lcd.setCursor(0,1);
  lcd.print(&quot;off time = &quot;);
    lcd.print(OffTime);
}</code></pre></div><br /><p>and the second one-which i need- is with remotexy app</p><div class="codebox"><pre><code>/*
   -- test --

   This source code of graphical user interface
   has been generated automatically by RemoteXY editor.
   To compile this code using RemoteXY library 2.4.3 or later version
   download by link http://remotexy.com/en/library/
   To connect using RemoteXY mobile app by link http://remotexy.com/en/download/
     - for ANDROID 4.3.1 or later version;
     - for iOS 1.3.5 or later version;

   This source code is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.
*/

//////////////////////////////////////////////
//        RemoteXY include library          //
//////////////////////////////////////////////

// RemoteXY select connection mode and include library
#define REMOTEXY_MODE__ESP8266WIFI_LIB_POINT
#include &lt;ESP8266WiFi.h&gt;

#include &lt;RemoteXY.h&gt;

// RemoteXY connection settings
#define REMOTEXY_WIFI_SSID &quot;RemoteXY&quot;
#define REMOTEXY_WIFI_PASSWORD &quot;12345678&quot;
#define REMOTEXY_SERVER_PORT 6377


// RemoteXY configurate
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
{ 255, 3, 0, 22, 0, 113, 0, 8, 13, 1,
  4, 0, 11, 12, 12, 64, 2, 26, 2, 0,
  19, 87, 22, 11, 2, 26, 31, 31, 79, 78,
  0, 79, 70, 70, 0, 4, 0, 41, 12, 12,
  64, 2, 26, 129, 0, 37, 78, 18, 6, 24,
  111, 102, 102, 32, 116, 105, 109, 101, 0, 129,
  0, 6, 78, 22, 6, 24, 111, 110, 32, 116,
  105, 109, 101, 0, 67, 5, 6, 5, 20, 5,
  2, 26, 11, 67, 5, 38, 5, 20, 5, 2,
  26, 11, 129, 0, 11, 11, 11, 3, 1, 115,
  101, 99, 111, 110, 100, 0, 129, 0, 43, 11,
  11, 3, 1, 115, 101, 99, 111, 110, 100, 0
};

// this structure defines all the variables of your control interface
struct {

  // input variable
  int8_t slider_on_time; // =0..100 slider position
  uint8_t switch_1; // =1 if switch ON and =0 if OFF
  int8_t slider_off_time; // =0..100 slider position

  // output variable
  char text_on_time[11];  // string UTF8 end zero
  char text_off_time[11];  // string UTF8 end zero

  // other variable
  uint8_t connect_flag;  // =1 if wire connected, else =0

} RemoteXY;
#pragma pack(pop)

/////////////////////////////////////////////
//           END RemoteXY include          //
/////////////////////////////////////////////
#include &lt;Wire.h&gt;
#include &lt;LiquidCrystal_I2C.h&gt;
LiquidCrystal_I2C lcd(0x27, 16, 2);

int ledPin =  D3;   //led pin to D2
int ledState = LOW;
unsigned long previousMillis = 0;


void setup()
{
  RemoteXY_Init ();
  pinMode(ledPin, OUTPUT);
lcd.init();
  lcd.backlight();
}

void loop()
{
  RemoteXY_Handler ();
  unsigned long currentMillis = millis();
  long Ont;
  long Offt;
  long OnTime = Ont;
  long OffTime = Offt;

  
  Ont = map (RemoteXY. slider_on_time , 0 , 100 , 0 , 5000 ) ;
  float ont = (float)Ont;                                          //convert long to float
  float v1_1n = ont / 1000;
  dtostrf(v1_1n, 0, 1, RemoteXY.text_on_time);                     //convert float to char

  Offt = map (RemoteXY. slider_off_time , 0 , 100 , 0 , 5000 ) ;
  float offt = (float)Offt;                                     //convert long to float
  float  v1_2n = offt / 1000;
  dtostrf(v1_2n, 0, 1, RemoteXY.text_off_time);                  //convert float to char


  
    if ((ledState == HIGH) &amp;&amp; (currentMillis - previousMillis &gt;= OnTime))
    {
      ledState = LOW;  // Turn it off
      previousMillis = currentMillis;  // Remember the time
      digitalWrite(ledPin, ledState);  // Update the actual LED
    }
    else if ((ledState == LOW) &amp;&amp; (currentMillis - previousMillis &gt;= OffTime))
    {
      ledState = HIGH; // turn it on
      previousMillis = currentMillis;   // Remember the time
      digitalWrite(ledPin, ledState);    // Update the actual LED
    }
  
  else {
    digitalWrite(ledPin, 0);
  }
  
lcd.setCursor(0,0);
  lcd.print(&quot;on time = &quot;);
    lcd.print(v1_1n);



  lcd.setCursor(0,1);
  lcd.print(&quot;off time = &quot;);
    lcd.print(v1_2n);
}</code></pre></div><p>i used the code below with each code above<br /></p><div class="codebox"><pre><code>int ledPin1 =  12;      // the number of the LED pin
int ledState1 = LOW;             // ledState used to set the LED
unsigned long previousMillis1 = 0;        // will store last time LED was updated
long OnTime1 = 250;           // milliseconds of on-time
long OffTime1 = 750;          // milliseconds of off-time

int ledPin2 =  13;      // the number of the LED pin
int ledState2 = LOW;             // ledState used to set the LED
unsigned long previousMillis2 = 0;        // will store last time LED was updated
long OnTime2 = 330;           // milliseconds of on-time
long OffTime2 = 400;          // milliseconds of off-time

void setup() 
{
  // set the digital pin as output:
  pinMode(ledPin1, OUTPUT);      
  pinMode(ledPin2, OUTPUT);      
}

void loop()
{
  // check to see if it&#039;s time to change the state of the LED
  unsigned long currentMillis = millis();
 
  if((ledState1 == HIGH) &amp;&amp; (currentMillis - previousMillis1 &gt;= OnTime1))
  {
    ledState1 = LOW;  // Turn it off
    previousMillis1 = currentMillis;  // Remember the time
    digitalWrite(ledPin1, ledState1);  // Update the actual LED
  }
  else if ((ledState1 == LOW) &amp;&amp; (currentMillis - previousMillis1 &gt;= OffTime1))
  {
    ledState1 = HIGH;  // turn it on
    previousMillis1 = currentMillis;   // Remember the time
    digitalWrite(ledPin1, ledState1);      // Update the actual LED
  }
  
  if((ledState2 == HIGH) &amp;&amp; (currentMillis - previousMillis2 &gt;= OnTime2))
  {
    ledState2 = LOW;  // Turn it off
    previousMillis2 = currentMillis;  // Remember the time
    digitalWrite(ledPin2, ledState2);  // Update the actual LED
  }
  else if ((ledState2 == LOW) &amp;&amp; (currentMillis - previousMillis2 &gt;= OffTime2))
  {
    ledState2 = HIGH;  // turn it on
    previousMillis2 = currentMillis;   // Remember the time
    digitalWrite(ledPin2, ledState2);      // Update the actual LED
  }
}</code></pre></div><p>video link <br /><a target="_blank" href="https://gofile.io/?c=hQHEW1">https://gofile.io/?c=hQHEW1</a></p>]]></description>
			<author><![CDATA[null@example.com (spiderus2014)]]></author>
			<pubDate>Fri, 29 Nov 2019 22:41:24 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=2457#p2457</guid>
		</item>
		<item>
			<title><![CDATA[Re: edit library >>>>help]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=2448#p2448</link>
			<description><![CDATA[<p>Hello,</p><p>Show your complete sketch, because in the code you posted there is nothing about wifi or remotexy.</p>]]></description>
			<author><![CDATA[null@example.com (Guillaume)]]></author>
			<pubDate>Mon, 25 Nov 2019 10:01:47 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=2448#p2448</guid>
		</item>
		<item>
			<title><![CDATA[edit library >>>>help]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=2442#p2442</link>
			<description><![CDATA[<p>hi everyone <br />i use node mcu esp8266 <br />I&#039;ve got a class can set time-off and time-on for led without delay function, but when i add it to my sketch and upload it to nodemcu<br />my phone can&#039;t see it&#039;s wifi network .<br />the class is working very well with UNO,<br />can i add the class to remotexy library and make it work with the app.<br />or any way to make it work please .</p><br /><p>the class and void setup and loop is</p><div class="codebox"><pre><code>class Flasher
{
    // Class Member Variables
    // These are initialized at startup
    int ledPin;      // the number of the LED pin
    long OnTime;     // milliseconds of on-time
    long OffTime;    // milliseconds of off-time

    // These maintain the current state
    int ledState;                     // ledState used to set the LED
    unsigned long previousMillis;      // will store last time LED was updated

  // Constructor - creates a Flasher 
  // and initializes the member variables and state
  public:
  Flasher(int pin, long on, long off)
  {
    ledPin = pin;
    pinMode(ledPin, OUTPUT);     
      
    OnTime = on;
    OffTime = off;
    
    ledState = LOW; 
    previousMillis = 0;
  }

  void Update()
  {
    // check to see if it&#039;s time to change the state of the LED
    unsigned long currentMillis = millis();
     
    if((ledState == HIGH) &amp;&amp; (currentMillis - previousMillis &gt;= OnTime))
    {
        ledState = LOW;  // Turn it off
      previousMillis = currentMillis;  // Remember the time
      digitalWrite(ledPin, ledState);  // Update the actual LED
    }
    else if ((ledState == LOW) &amp;&amp; (currentMillis - previousMillis &gt;= OffTime))
    {
      ledState = HIGH;  // turn it on
      previousMillis = currentMillis;   // Remember the time
      digitalWrite(ledPin, ledState);      // Update the actual LED
    }
  }
};


Flasher led1(12, 100, 400);
Flasher led2(13, 350, 350);

void setup()
{
}

void loop()
{
    led1.Update();
    led2.Update();
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (spiderus2014)]]></author>
			<pubDate>Sun, 24 Nov 2019 12:06:04 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=2442#p2442</guid>
		</item>
	</channel>
</rss>
