Asked — Edited

Holiday Lights - Looking For A Script

Good Morning!

I had a thought of using my EZB to turn on and turn off my holiday lights on my house. The only issue I think I may have is the code. I do not know enough code to turn on lights at 6pm and then turn off at 11pm.

Would anyone in the community be willing to help with this code?

Thanks Wayne


ARC Pro

Upgrade to ARC Pro

Elevate your robot's capabilities to the next level with Synthiam ARC Pro, unlocking a world of possibilities in robot programming.

#1  

This code will do the timing;


:start

WaitUntilTime(18,00)

#turn on the lights

WaitUntilTime(23,00)
#turn off the lights

GoTo(start)


#2  

@bhouston This is all that is needed? Seems to easy!

#3  

You will have to put in what you are doing to turn the lights on and off. How are you doing that?

#4  

My thought was to turn a Digital Pin high to turn on a transitor, to turn on a relay.

That should work?

I know the Digital Pin cannot sink or source a lot of current. So, I would need a transistor. OR, find a 5V relay with a low amount of current needed to operate, then that could drive the coil of a 120V AC relay, then the contacts would in turn drive the lights on my house.

At the time I asked the question, I really did not put much thought into the electronics needed to make it work. I thought it was a silly idea, but since I am not home at dark, I thought it would be kinda cool for the lights to turn on and off by themselves.

Has anyone on the forum done this before?

#5  

Given that you also need to power the EZ-B, this seems kind of overkill when you can do the same thing with a $10 electric timer, but just as a proof of concept that it can be done, yeah, no reason your concept shouldn't work.

Alan