Shop OBEX P1 Docs P2 Docs Learn Events
A/D and time delay — Parallax Forums

A/D and time delay

bhaidonbhaidon Posts: 1
edited 2008-11-17 02:17 in BASIC Stamp
Hi All,

I am trying achieve the following

read data from·A/D chip ADC0831 and if value is less than 0.5 V for·20 seconds sound an alarm (red led) or show a green led blinking every 1 second.

I have been able to get data from the ADC0831, but the 20 second part is where I am struggling.

Could someone help me with it?

Thanks
·

Comments

  • FranklinFranklin Posts: 4,747
    edited 2008-11-17 02:17
    Since the stamp has no time keeping functions the cheapest way to do thei is to time a loop that reads the ADC and then blink the led, increment a counter and check if it has reached 20. then extend the total time the loop takes to one second.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
Sign In or Register to comment.