counter function
LW
Posts: 8
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
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
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.