sleep() routine for sbasic?

Oct 07, 2003 1 Replies

Is there an easy way to sleep() in sbasic, say for 600us?



Tom



Hi Tom,

Dunno if this helps, but here's my core sbasic code with a sleep function. You can replace the wait = x * 250 with wait = x to get finer control than full seconds...

include "regs11.lib"

declare wait declare x

interrupt $fff0 if wait 0 wait = wait - 1 endif pokeb tflg2, %01000000 end

Initialize: 'enable serial port pokeb baud, $30 pokeb sccr2, $0c

'setup interrupts pokeb tflg2, %01000000 pokeb tmsk2, %01000000

interrupts on

return

Sleep: x = pull()

wait = x * 250 do loop until wait = 0

return

main: gosub Initialize

do print "Bubba WUZ Here..." gosub Sleep, 5 print "BOO" loop end

HTH Stetve

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required