Is lookup command very slow? I have worked with a small stepper motor and has been a little bit confused. In an attempt to make my program a little more elegant, I have rewritten SlowCW routine to FastCW routine as shown here.
SlowRW would in my opinion do exactly as FastCW, but FastCW run my stepper motor twice as fast ..
What have I missed?
Code:
#picaxe 14M2
#No_Data
Symbol rest = 1
DirsB = %00011110
do
gosub SlowCW
Pause 1000
gosub FastCW
pause 1000
loop
SlowCW:
for w4= 1 to 3000
for b2 = 0 to 3
lookup b2, ($06,$0C,$18,$12), pinsB
pause rest
next b2
next w4
return
FastCW:
for w4= 1 to 3000
let PinsB = $06
pause rest
let PinsB = $0C
pause rest
let PinsB = $18
pause rest
let PinsB = $12
pause rest
next w4
return
What have I missed?