Society of Robots - Robot Forum
Software => Software => Topic started by: javila on September 12, 2010, 10:49:57 AM
-
Hello:
I am using the solarbotics/l298 function for my robot, and it allows me to change the speed of the wheels but
I have not been able to change the direction of the wheels unless I change :
SOLAR_L298_MOTOR left = MAKE_SOLAR_L298_MOTOR(FALSE, B1,B4,B5);
SOLAR_L298_MOTOR right = MAKE_SOLAR_L288_MOTOR(TRUE , B2,B6,B7);
at the beggining of the code either with changing true to false or the other way or the two last pins. but then lets say I want to receive input from the keyboard f=forward r=reverse
how do I implement that.
thanks in advance
-
your example shows how it defines the motor but doesn't show the code that you use to set the speed of a motor.
If you are using Project Designer and save your project to a 'new' folder before generating the code then Project Designer will say 'its a new project' and generate code to move the motor back and forth, along with the AVRStudio project. So just open it in AVRStudio, compile and run. Your motor should be going backwards and forwards without you having to write a single line of code. Certainly works with my motor.
-
but then lets say I want to receive input from the keyboard f=forward r=reverse how do I implement that.
See my source code for my ERP:
http://www.societyofrobots.com/robot_ERP.shtml#webbotlib_code (http://www.societyofrobots.com/robot_ERP.shtml#webbotlib_code)