i dont really know whats going on... ive been playing with it for a bit this weekend, and something funny is going on..
when i hold the board about 2" above the motors, everything works fine, if its closer, it will start to speed up, and then just completely stop, and wont reset.
if i plug in my serial LCD and keep the board 2" away from the motors, they run fine, but the LCD will work for a bit, then go blank, and then work a bit more, and go blank and then work more.
with the board beside the motors, the LCd will start, go all black, and then come back and the motors will stop. then the lcd will keep displaying the speed variable changing, so somewhere in there, i think the motor reset is being tripped and its not restarting.
heres a tiny bit of my code...
baudLCD CON 32 'baud rate for lcd
lcd VAR PORTF.0 'serial lcd port
motor VAR PORTD.0 'serial motor port
motorreset VAR PORTE.7 'reset pin For motor controller
baudmotor CON 84 'baud rate for motor
LBAK CON 1 'left backwards
LFWD CON 0 'left forwards
RBAK CON 3 'right backwards
RFWD CON 2 'right forward
speed VAR BYTE
start:
High lcd
High motor
High motorreset
SerOut2 lcd, baudlcd,[254,"G",1,1,"Treadbot"] 'display treadbot on lcd in position 1,1
Pause 1000
For speed = 0 TO 80 'speed up motor to full speed
SerOut2 lcd, baudlcd,[254,"G",1,4,#speed," "] 'display speed var on lcd in position 1,4
SerOut2 motor, baudmotor, [$80, 0, lfwd, speed] 'left motor forward
SerOut2 motor, baudmotor, [$80, 0, rfwd, speed] 'right motor forward
Pause 150
Next
Pause 10000
'drive at full speed for 10 sec
For speed = 80 TO 1 STEP - 1 'slow down motor until stop
SerOut2 lcd, baudlcd,[254,"G",1,4,#speed," "] 'display speed var on LCD in position 1.4
SerOut2 motor, baudmotor, [$80, 0, lfwd, speed] 'left motor forward
SerOut2 motor, baudmotor, [$80, 0, rfwd, speed] 'right motor forward
Pause 150
Next
Bookmarks