wijnendael
Member
I recently removed a couple of motors from a old epsom printer EM236 & EM237. i am running the EM236 with a L298N ic and everything seems to work ok. However the motor will not run at a fast speed like it does in a printer when it travels very fast from one end to the other, is this because of the code i am using or does it have to be done through gearing ? my code is as follows:-
Code:
let dirsB = %00001111 ; make pins output
main: for b3 = 0 to 20 ; start a for...next loop
if pinc.0=1 then
gosub lstep
endif
if pinc.1 = 1 then
gosub rstep
endif
next b3 ; next loop
goto main ; repeat
lstep: let b1 = b1 + 1 ; add 1 to variable b1
gosub stepit ; do the step
return
rstep: let b1 = b1 - 1 ; subtract 1 from variable b1
gosub stepit ; do the step
return
stepit: let b1 = b1 & %00000011 ; mask lower two bits of b1
lookup b1,(%1010,%1001,%0101,%0110),b2 ; lookup code into b2
let pinsB = b2
return