<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[RemoteXY community — push button and timer]]></title>
	<link rel="self" href="https://forum.remotexy.com/extern.php?action=feed&amp;tid=1512&amp;type=atom" />
	<updated>2022-07-04T21:19:19Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.remotexy.com/viewtopic.php?id=1512</id>
		<entry>
			<title type="html"><![CDATA[Re: push button and timer]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=4724#p4724" />
			<content type="html"><![CDATA[<p>Thank You for your help... I&#039;ll be working on it this week!!!</p>]]></content>
			<author>
				<name><![CDATA[dmccullough30]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=2163</uri>
			</author>
			<updated>2022-07-04T21:19:19Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=4724#p4724</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: push button and timer]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=4706#p4706" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>uint8_t button_1;             // =1 if switch ON and =0 if OFF -RemoteXY

const int LED_1_PIN = 5;

unsigned long ledTimer = 0;
unsigned int ledTimeOn = 5000;  //Time on for LED

void setup()
{
  pinMode(LED_1_PIN, OUTPUT);
}

void loop()
{
  if (ledTimer == 0)
  {
    // Add more buttons below, could be done in an array for simplifying
    if (RemoteXY.button_1 == 1)
    {
      ledTimer = millis();
      digitalWrite(LED_1_PIN, HIGH);
    }
  }
  if (ledTimer &gt; 0)
  {
    if (millis() - ledTimer &gt;= ledTimeOn)
    {
      // Add more buttons below, could be done in an array for simplifying
      if (RemoteXY.button_1 == 1)
      {
        ledTimer = 0;
        digitalWrite(LED_1_PIN, LOW);
        RemoteXY.button_1 = 0;
      }
    }
  }
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[jhome0005]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=1504</uri>
			</author>
			<updated>2022-06-29T13:08:52Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=4706#p4706</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[push button and timer]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=4704#p4704" />
			<content type="html"><![CDATA[<p>I want to set 8 buttons up that allow me to set up a timer for each one. Once pushed on the others are ignored until the timer reaches zero. Then I want the button to revert back to the &quot;off&quot; color or its original state on the phone. I can successfully use the on off switch to control the LED but I have to manually turn it off on the phone. Suggestions??</p>]]></content>
			<author>
				<name><![CDATA[dmccullough30]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=2163</uri>
			</author>
			<updated>2022-06-28T19:45:41Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=4704#p4704</id>
		</entry>
</feed>
