Knightryder
New Member
Hi there
I am new to picaxe but have created a 7 segment display circuit. I have sucessfully written a program to make it count up using 08M setup(see below)
My aim is to try and replicate a stop watch.
main: let b1 = 9 'give variable b1 the value 9
gosub clock 'call sub-procedure
pause 1000 'wait 1 second
goto main 'loop
clockulsout 1,10 'reset display to 0
if b1 = 0 then endclk 'if b1 = 0 then return
for b3 = 0 to b1 'start a for next loop
pulsout 0,10 'pulse clock line
pause 1000 'pause
next b3 'next loop
goto clock 'return from sub-procedure
endclk:return
I would now like to program in a routine that makes it stop counting when i press the 'push to make' switch and for it to reset when i press and hold the ptm switch.
any help would be greatly appreciated
Many thanks
I am new to picaxe but have created a 7 segment display circuit. I have sucessfully written a program to make it count up using 08M setup(see below)
My aim is to try and replicate a stop watch.
main: let b1 = 9 'give variable b1 the value 9
gosub clock 'call sub-procedure
pause 1000 'wait 1 second
goto main 'loop
clockulsout 1,10 'reset display to 0
if b1 = 0 then endclk 'if b1 = 0 then return
for b3 = 0 to b1 'start a for next loop
pulsout 0,10 'pulse clock line
pause 1000 'pause
next b3 'next loop
goto clock 'return from sub-procedure
endclk:return
I would now like to program in a routine that makes it stop counting when i press the 'push to make' switch and for it to reset when i press and hold the ptm switch.
any help would be greatly appreciated
Many thanks