Hi DynamoBen,
I wrote a short bit of code here that compiles to 74 words. I'm not sure if it's what you were looking for but I thought I'd post it anyway.
The first press and release of the button after a hearing a single beep of the buzzer will INCREMENT your variable. Any further (single quick press's) that sounds a single beep will continue to increment the variable and when your finished incrementing then holding the button down for 4.5 seconds will ENTER the variable and exit the loop.
If you wanted to increment and enter another variable using the same push button then you could place another IF-THEN in the loop and when it beeps a set number of times then the code could jump out of that loop into another loop and the same basic code could be repeated for a different variable (with a little modification to the original code below).
Also an Led could be used instead of the buzzer. I'm not sure but I think this is what you wanted?
IF Settings_Push_Button = Is_Pressed THEN
For i = 0 to 100'this ensures that we return to mainloop
WHILE Settings_Push_Button = Is_Pressed
PWM Buzzer,250,1 : PAUSE 1500 : Y = Y + 1
IF Y = 3 THEN
'Do the ENTER
Y = 0
IF Y = 0 THEN EXIT
ENDIF
WEND
IF Y = 2 THEN
Y = 0
'Do the Increment
ENDIF
PAUSE 100
NEXT i
ENDIF
EXIT:
jessey
Bookmarks