0 to 60 counter
axial28rr
Posts: 16
hey guys
i need to make a 60 second countdown timer with 2 push buttons 1 push button need to set a number in the TENS coulum and sets that number value .
the second pushbutton needs to set a number in the ONES colum then sets that number value
then when both push buttons are pushed it counts down to "0"
this is what i have so far
what am having prblems with is that when i push a button its shows all 9 numbers (0 -9)insted of 1 number
ex i push the push button 6 times i shoud see 0 to 5 on the debug and its sets that number
thanks
i need to make a 60 second countdown timer with 2 push buttons 1 push button need to set a number in the TENS coulum and sets that number value .
the second pushbutton needs to set a number in the ONES colum then sets that number value
then when both push buttons are pushed it counts down to "0"
this is what i have so far
what am having prblems with is that when i push a button its shows all 9 numbers (0 -9)insted of 1 number
ex i push the push button 6 times i shoud see 0 to 5 on the debug and its sets that number
thanks
' What's a Microcontroller - SegmentTestWithHighLow.bs2 ' Individually test each segment in a 7-Segment LED display. '{$STAMP BS2} '{$PBASIC 2.5} startval VAR Nib ENDval VAR Nib x VAR Nib y VAR Nib main: FOR y = startval TO endval DEBUG DEC x ,CR IF IN3 = 1 AND IN4 = 0 THEN startval = 0 endval = 9 LOOKDOWN x, [1,2,3,4,5,6,7,8,9],x LOOKUP y, [%10111110, %00010010, %01111100, %01110110, %11010010, %11100110, %11001110, %00110010, %11111110, %11110010], y ENDIF NEXT FOR y = startval TO endval GOSUB main DEBUG DEC x ,CR IF IN3 = 0 AND IN4 = 1 THEN startval = 0 endval = 9 LOOKDOWN x, [1,2,3,4,5,6,7,8,9],x LOOKUP y, [%10111110, %00010010, %01111100, %01110110, %11010010, %11100110, %11001110, %00110010, %11111110, %11110010], y DIRH = %11111111 ENDIF NEXT
Comments
And there are other logical and syntax errors.
You need to compile it first before troubleshooting these errors.
Is this a direct copy from the text you are quoting ?
Can you copy and post the code from the text you are using?