![]() |
Re: Robot Drifting
Quote:
|
Re: Robot Drifting
Quote:
You don't evaluate (150/100). You evaluate (x * 150 / 100). To get a floating point effect you do all your multiplication first, then all your division. In integer math,e.g., x = 150/100 * 100 = 100 but x = 100 * 150 / 100 = 150 Just be careful to type cast the expression to the largest size you need, e.g., using all char for the above will return an incorrect result. |
Re: Robot Drifting
You Constant (#define) can be a floating point value.
but.... when you apply it in your program the result will be an int. ie. #define CONSTANT 1.5 int adjust_speed(int speed_in) ( int speed_out; speed_out = (speed_in/CONSTANT); return speed_out; //sends back an int ) |
Re: Robot Drifting
Quote:
We don't use any of them during driving mode, although we do sometimes modify the power curve to give more range at the low-end. There are lots of answers and you'll see as many software solutions as robot solutions to FIRSTs game. It's part of what makes it all so interesting.:cool: |
Re: Robot Drifting
Quote:
Code:
#define CONSTANT 3/2 |
| All times are GMT -5. The time now is 00:02. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi