programing help: I need to check a range.
Philip T.
Posts: 8
I have a Variable called Gyro.
If this VAR is between 740 and 760 I need my program to skip a couple of lines of code.
How do I code this?
thanks in advance.
If this VAR is between 740 and 760 I need my program to skip a couple of lines of code.
How do I code this?
thanks in advance.
Comments
IF gyro<760 AND gyro>740 THEN SkipState
If you can give me a value for Gyro that fulfills your conditions....:^)
In short, I think that you are looking for OR instead of AND in the way you have it coded...
Keep 'em comin'...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Truly Understand the Fundamentals and the Path will be so much easier...
My gyro returns a value of 750 when my Trooper is still. It uses the full range when driveing down the road straight.
Actually about 743 to 757. The BSII controlls the shockabsorbers extending and retracting to counter roll in a corner.
My old code would just bank left to if above 760 and bank right below 740.
The new code watches the Gyro value and looks for a shift in it. This way it can change states before I Pass through "the dead zone".
So the Line of code I need is for when the truck is running straight down the road to avoid cycling the hydralics.
I hope this isnt to wordy.
Here's the Hydralic schematics. And my latest Code if you are realy bored.
mea culpa
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Truly Understand the Fundamentals and the Path will be so much easier...