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.