system
March 12, 2013, 3:34pm
1
Hi, i found this code on the internet:
#define Kp 2.0f // proportional gain governs rate of convergence to accelerometer/magnetometer
#define Ki 0.005f // integral gain governs rate of convergence of gyroscope biases
#define halfT 0.5f // half the sample period
Wahat the mean of "f" at 2.0f, 0.005f, and 0.5f?
pylon
March 12, 2013, 3:39pm
2
Possibly "float" but it depends how the definitions are used later on. In this code it's just definition for the precompiler.
pylon:
Possibly "float" but it depends how the definitions are used later on. In this code it's just definition for the precompiler.
How if i deleted "f" and just use the number? I found many definition like this, for example:
#define GRAVITY 16384.0f
#define SCALE_PID_PARAMS 1000.0f
But i still confused what is the mean of "f"..
This has a good answer, there are links to relevant info:
c++, syntax, casting
No worries, remember stack overflow, it has a lot of great non-Arduino answers ( arduino stuff too ).