Luftwaffle
New member
I am really new to programming with BASIC for the picaxes and I am having some trouble making a timer. I am using a seven-segment display to display a number that will indicate the number of every ten seconds. I have found that the timer works for the 'main' and 'zeroTimer' but it stops working of anything afterwards. the labels 'zero' and 'one' are just subroutines to configure the seven segment display.
Is there any way I can make the internal timer work during all of the subroutines?
main:
setfreq m4
'enabletime
let w0 = Time + 10
zeroTimer:
gosub zero
do
high c.6
pause 250
low c.6
pause 250
loop until pinC.7=1
low c.6
wait 3
oneTimer:
gosub one
'setfreq m4
'let w0 = Time + 10
do
if Time >= w0 then
w0 = Time + 10
goto zeroTimer
endif
loop until pinC.7=1
wait 1
Is there any way I can make the internal timer work during all of the subroutines?
main:
setfreq m4
'enabletime
let w0 = Time + 10
zeroTimer:
gosub zero
do
high c.6
pause 250
low c.6
pause 250
loop until pinC.7=1
low c.6
wait 3
oneTimer:
gosub one
'setfreq m4
'let w0 = Time + 10
do
if Time >= w0 then
w0 = Time + 10
goto zeroTimer
endif
loop until pinC.7=1
wait 1
Attachments
-
2 KB Views: 3