The wires are fine, soldering and everything, the camera works simply put, the wheels are UNRESPONSIVE! The code I am using is the one form ‘My First Robot’. I just do not know…
you can check to make sure that you are getting signals to and from where they should be going. Also, make sure you are getting 5 volts to the PICAXE.
First, check the PICAXE pins to make sure you are getting a HIGH where you think you should be getting a HIGH. Follow that to the motor driver chip, L293D I believe. See that you are getting HIGHs and LOWs where they are needed. See that you are getting HIGHs and LOWs on the outputs to the motors.
Make sure that your L293D is plugged in in the correct orientation.
Ok. First off thanks for the help, the motors are running fine now, but I am having some troubles with the code. First thing, when moving during ‘no danger’ he only scoots forward an inch or so. How can I tell him to go further? Also, for some reason when deciding ‘Which way is better’ he acts rather sporadic and only seems to notice the ‘wall’ once, then proceeds to charge it at an inch a minute.
Re-write the whole program all by yourself, know what each line means and does, check the sensor’s sensiblity by using only the sensor program and change your dangerlevel according to your sensor’s sensibility. check if all solders are done properly any loose solders will result in such “sporadic” movements
I know I have correctly soldered for that was my first problem with the motors, and I have a solid dangerlevel for my system. I have been running through the code so much I can no longer make him run a straight line… so here it is
symbol dangerlevel = 140 symbol turn = 300 symbol servo_turn = 700 'new symbols symbol scenter = 150 'adjust to set servo center symbol sright = 100 'adjust to set servo right symbol sleft = 200 'adjust to set servo left symbol lmbp = 4 'left motor back pin symbol lmfp = 5 'left motor forward pin symbol rmbp = 6 'right motor back pin symbol rmfp = 7 'right motor forward pin symbol ir_sensor = 1 'analog input pin symbol sensor_servo = 0 'ir_sensor servo pin symbol dist_front = b1 symbol dist_left = b2 symbol dist_right = b3
main: readadc ir_sensor, dist_front if dist_front < dangerlevel then gosub nodanger else gosub whichway end if goto main
nodanger: 'changed to increase readability 'low 4 : high 5 : low 6 : high 7 gosub leftmotorforward gosub rightmotorforward return
whichway: gosub totalhalt gosub lturn 'pause servo_turn 'readadc 1, b1 gosub totalhalt gosub rturn 'pause servo_turn 'readadc 1, b2 gosub totalhalt if dist_left > dist_right then gosub body_lturn else gosub body_rturn end if return
totalhalt: 'changed to help readability 'low 4 : high 5 : low 6 : high 7 'this will make the motors go forward gosub leftmotorstop gosub rightmotorstop servo sensor_servo, scenter wait 1 return