raitl
New Member
Hi.
Writing a code for my bot and I ran into this problem...
The following is a piece of my code for moving the stepper motors.
and to move 10 steps forward:
The problem is, that how can I save the motors position so I can pick up where I left off after doing something else?
Writing a code for my bot and I ran into this problem...
The following is a piece of my code for moving the stepper motors.
Code:
STEPS macro number
movlw number
movwf STEPCOUNT
endm
STEPPER macro dir
movlw dir
movwf PORTB
WAIT .100
DECF STEPCOUNT,1
btfsc STATUS,Z
goto loop
endm
and to move 10 steps forward:
Code:
STEPS .10
forward
STEPPER 0x88
STEPPER 0x9A
STEPPER 0x12
STEPPER 0x56
STEPPER 0x44
STEPPER 0x65
STEPPER 0x21
STEPPER 0xA9
goto forward
The problem is, that how can I save the motors position so I can pick up where I left off after doing something else?