BS2 Need help counting momentary low input events
Donny23
Posts: 8
I am not an expert but, in desperate need of some help here.
I'm using the DS1302 and am trying to use 2 momentary reset switches #1 and #2. What I can't figure out is: how can I tap #1 THEN #2 to get it to start counting? With this, I need it only to stop counting by tap of #2 THEN #1 in that order. I've been trying to alter the demo DS1302 counter program. The switches are lowing the pins 4 and 5. Also, I need this to be able to be repeated but, keep the elapsed times history in debug somehow. Please, if someone can guide me in the right direction it would be greatly appreciated. I am using the BS2
I must not be adding to variables correctly or if I'm even going the right direction now. Thank you.
I'm using the DS1302 and am trying to use 2 momentary reset switches #1 and #2. What I can't figure out is: how can I tap #1 THEN #2 to get it to start counting? With this, I need it only to stop counting by tap of #2 THEN #1 in that order. I've been trying to alter the demo DS1302 counter program. The switches are lowing the pins 4 and 5. Also, I need this to be able to be repeated but, keep the elapsed times history in debug somehow. Please, if someone can guide me in the right direction it would be greatly appreciated. I am using the BS2
I must not be adding to variables correctly or if I'm even going the right direction now. Thank you.
Comments
That will be when switch #1 and #2 get pressed again.
Also, for some reason the "generate object code" exe file says download ok but nothing happens. What am I doing wrong? This is gonna sound funny but is there a way to enlarge font size in debug or can I do that in the exe file when I finally get that to work?
Your sample does help tremendously though and can think of many ways to make things easier doing that.
Thanks
counter VAR Byte
DO
DEBUG ? IN4
IF (IN4 = 0)THEN
PAUSE 1000
counter = counter + 1
ENDIF
DEBUG CRSRDN
DEBUG CRSRDN
DEBUG ? IN5
IF (IN5 = 0)THEN
PAUSE 1000
counter = counter + 1
ENDIF
DEBUG CRSRDN
DEBUG ? counter
PAUSE 100
IF counter = 2 THEN
GOTO Start
ENDIF
LOOP
Start:
mins = $00
secs = $00
GOSUB Set_Time
DO
GOSUB Get_Time
DEBUG HOME, HEX2 mins, ":", HEX2 secs
LOOP
DEBUG CR, CR, "ELAPSED TIME"
STOP