07-16-2012 12:38 AM
I've been trying to solve this problem for about a week. I know for some of you that this might be simple. Ok...here goes.
I can get the current time very easily. However, how do you make a timer that turns on the virtual LED at a specific time. Example: 8am. And Switches off at another specific time. Example: 11pm.
07-16-2012 01:25 PM
paem,
This can be done in several ways. The choice may depend on what else the program is to do and how the user will interact with it.
The basics consist of a loop which reads the current time and compares it to the specified time(s) to turn on or off. It will also have a delay so that the program does not consume all available CPU resources.
Please post what you have tried so far along with an indication of what does not work about it.
Lynn
07-16-2012 01:30 PM - edited 07-16-2012 01:31 PM
Depending on what you want to do, you can probably use the in range and coerce function to take care of the comparison in one node, as long as you set up the upper and lower limits properly. As was suggested, post what you have and people can help you more easily.
07-18-2012 03:56 AM
This is what i have currently.
09-09-2012 06:08 PM
@paem wrote:
I've been trying to solve this problem for about a week. I know for some of you that this might be simple. Ok...here goes.
I can get the current time very easily. However, how do you make a timer that turns on the virtual LED at a specific time. Example: 8am. And Switches off at another specific time. Example: 11pm.
range your case structure to the 24 hour format...
also, "timer for lights"...sorry for reviving this post!