View Single Post
  #9   Spotlight this post!  
Unread 16-01-2002, 23:01
Joseph F Joseph F is offline
Registered User
#0506 (Steel Friars)
 
Join Date: Jan 2002
Location: New York
Posts: 59
Joseph F is an unknown quantity at this point
Send a message via AIM to Joseph F
Quote:
If p1_trig = 0 then DoNothing
Left_wheels = 254 - (Left_wheels MAX 254)
Right_wheels = 254 - (Right_wheels MAX 254)
DoNothing:
The above is probably the simplest way to do it. I tend to drag it out more in my program simply because I like to see the thinking process. However you have to then tell it what right_wheel and left_wheel are. I presume there pwm1 and pwm2 as listed in tankdrive. Make sure to put this just after the tankdrive section.

Quote:
Left_wheels = ~Left_wheels
Right_wheels = ~Right_wheels
This may work. I'm not exactly sure about negations in pbasic. It could end up attempting to put in a negative... Use it at your own risk.


The code I put in is untested but shows exactly what it does step by step. Its probably not the best but it should work. Just try them 1 at a time and see which one you like. A standard 2 position switch, a button on the joystick, or even the wheel on the joystick can be used to control which way it drives.

If you have specific questions on the pbasic editor you can post them here or feel free to e-mail me. I taught myself how to use it and the basic program commands in under a week so it shouldn't be that hard to help you if you need.
__________________
One Team, One Bot, One Fleet of Ambulances!