Shop OBEX P1 Docs P2 Docs Learn Events
programing a push button — Parallax Forums

programing a push button

samcast101samcast101 Posts: 1
edited 2007-11-22 20:48 in BASIC Stamp
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

  • Mike GreenMike Green Posts: 23,101
    edited 2007-11-22 20:40
    You really need to do the work yourself.

    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 ...
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2007-11-22 20:48
    samcast101

    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·idea.gif·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
Sign In or Register to comment.