programing a push button
samcast101
Posts: 1
I need to write a program to save energy on my project. the program cosists of a push button connected to pin 1 and a relay connected to pin 2. i need a program that would send a low singal to pin 2(relay) if the push buton hasn't been pushed for 10 minutes. but if the push button is push before the 10 minutes the counter would reset to start 10 minutes again. Can somebody please help me?
·
·
Comments
An easy thing to do is to set up a loop to check the pushbutton once every 100ms using a PAUSE statement for the timing.
Keep a count of the number of times through the loop. 10 minutes is 6000 x 100ms. Take it from there ...
For the Button Demo it is in the Basic Stamp Editor look in the BS2 Folder
for keep the time use a DS1302 Time Chip that Parallax sells do not for get the crystal
And use the DS1302 Counter Demo Code it below so is the Button Demo
This should get you started
You also could do what Mike Green has in his post
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
··Thanks for any··that you may have and all of your time finding them
·
·
·
·
Sam
Post Edited (sam_sam_sam) : 11/22/2007 8:53:44 PM GMT