Shop OBEX P1 Docs P2 Docs Learn Events
counter function — Parallax Forums

counter function

LWLW Posts: 8
edited 2012-08-30 11:10 in BASIC Stamp
Hi Very new to this.
I am trying to use a basic stamp2 as a simple fuel tank display. Using a flow sensor. I need to be able to set the fuel tank contents as a variable. Im trying to use the counter function to increment the value up from 0 whilst holding a button in untill a required value is reached then stop value increasing when button released and store as "Tank". Then i need to allow the flow sensor to reduce the tank contents.
I have managed to get the variabl Tank to count Up but i cant get it to stop and store the variable.
any ideas greatly apreciated.

Lynton

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2012-08-30 11:10
    Anytime you've got a programming question, it helps to provide your program's source code ...

    attachment.php?attachmentid=78421&d=1297987572

    You might consider using a BUTTON statement in a loop that increments a counter. It has provisions for an auto-repeat The COUNT statement isn't quite what you need here. It counts pulses with a timeout.
Sign In or Register to comment.