2

Author Topic: webbotlib motor direction  (Read 729 times)

0 Members and 1 Guest are viewing this topic.

Offline javilaTopic starter

  • Jr. Member
  • **
  • Posts: 31
  • Helpful? 0
webbotlib motor direction
« 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

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,166
  • Helpful? 111
Re: webbotlib motor direction
« Reply #1 on: September 12, 2010, 05:01:53 PM »
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.
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,666
  • Helpful? 169
    • Society of Robots
Re: webbotlib motor direction
« Reply #2 on: September 16, 2010, 03:35:41 PM »
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

 


Get Your Ad Here

data_list