ercotronic
Member
Hi all,
is it possible (and correct)to nest subroutines using a 'then ' statment as in the 'i/o' section of code below)
e.g.
loop:
gosub i2clock 'get time
gosub i2 display 'display time
gosub i/o 'check pins
let b13 = 253 'load a test value
gosub keya 'to check keypad
if b13 <> 253 then keyb 'against
goto loop
end
i2clock:
"clock stuff here"
return
i2disp:
"lcd stuff here"
return
i/o: 'check for change of
if pin1 = 1 and $50 = 0 then delrc ' state
if pin1 = 0 and $50 = 1 then delro ' test
return
delrc
pause 50
if pin 1 = 0 then loop
let b0 = 1
peek $50,b0
gosub i2clock 'get time
gosub i2eewrite 'log time
gosub eeverif 'check if logged ok
return
many thanks for any input.
is it possible (and correct)to nest subroutines using a 'then ' statment as in the 'i/o' section of code below)
e.g.
loop:
gosub i2clock 'get time
gosub i2 display 'display time
gosub i/o 'check pins
let b13 = 253 'load a test value
gosub keya 'to check keypad
if b13 <> 253 then keyb 'against
goto loop
end
i2clock:
"clock stuff here"
return
i2disp:
"lcd stuff here"
return
i/o: 'check for change of
if pin1 = 1 and $50 = 0 then delrc ' state
if pin1 = 0 and $50 = 1 then delro ' test
return
delrc
pause 50
if pin 1 = 0 then loop
let b0 = 1
peek $50,b0
gosub i2clock 'get time
gosub i2eewrite 'log time
gosub eeverif 'check if logged ok
return
many thanks for any input.