View Single Post
  #7   Spotlight this post!  
Unread 16-01-2002, 22:45
Jnadke Jnadke is offline
Go Badgers!
#0093
Team Role: Alumni
 
Join Date: Jan 2002
Location: Appleton, WI
Posts: 775
Jnadke is on a distinguished road
Send a message via ICQ to Jnadke Send a message via AIM to Jnadke Send a message via Yahoo to Jnadke
Re: This is easily done...

Quote:
Originally posted by Joe Johnson
Suppose you have a switch called p1_trig.

.....
If p1_trig = 0 then DoNothing
Left_wheels = 254 - (Left_wheels MAX 254)
Right_wheels = 254 - (Right_wheels MAX 254)
DoNothing:
....

K.I.S.S.

Left_wheels = ~Left_wheels
Right_wheels = ~Right_wheels


Just a simple inverse of the bits. As long as you do that min and max stuff where it is supposed to be done (in the drive calculations), you should be fine.