I have a small bipolar stepper motor conventionally connected via an L293 to an 08M, using this code:
#picaxe 08m
LOW C.0,C.1,C.2,C.4
main:
do
b1 = b1 & %00000011 ' mask lower two bits of b1
lookup b1,(%00010010,%00010001,%00000101,%00000110),b0 ' lookup code into b0
pins = b0 'output b0 onto control lines
pause 200
let b1 = b1 + 1 'add 1 to variable b1
debug
loop
The motor action is not good.
In the simulator b0 returns 18, 17, 5 or 6, as expected. (00010010, 00010001, 00000101 or 00000110)
But when running the code, the debug command only returns b0 as 18 or 6.
I'm baffled. Can anyone think of an unbafflement clue?
thanks
#picaxe 08m
LOW C.0,C.1,C.2,C.4
main:
do
b1 = b1 & %00000011 ' mask lower two bits of b1
lookup b1,(%00010010,%00010001,%00000101,%00000110),b0 ' lookup code into b0
pins = b0 'output b0 onto control lines
pause 200
let b1 = b1 + 1 'add 1 to variable b1
debug
loop
The motor action is not good.
In the simulator b0 returns 18, 17, 5 or 6, as expected. (00010010, 00010001, 00000101 or 00000110)
But when running the code, the debug command only returns b0 as 18 or 6.
I'm baffled. Can anyone think of an unbafflement clue?
thanks