Commits

Jody McAdams committed 2a5285b

changed scale factor to be a setting at the top

Comments (0)

Files changed (1)

Sensors/Gyro/Gyro.ino

 
 #include <Wire.h>
 
-#define lowPassFilteringFactor 0.1f
+const int sensorRotationScaleDPS = 500; //(can be 250, 500, or 2000)
 
 //Allow the gyroscope values to be filtered to reduce noise
 #define ENABLE_FILTERING true
 
+//Used for low pass filtering
+const float lowPassFilteringFactor = 0.1f;
+
 //If ENABLE_FILTERING is on, use Kalman filtering instead of low pass filtering
 #define USE_KALMAN_FILTER true
 
 //For Kalman filtering
-const float Kalman_SensorNoise = 8.0f;  //Adjust this based on your sensor
+const float Kalman_SensorNoise = 8.0f;  //Adjust this based on the noisiness sensor
 
 typedef struct
 {
   Serial.begin(9600);
 
   Serial.println("starting up L3G4200D");
-  setupL3G4200D(500); // Configure L3G4200  - 250, 500 or 2000 deg/sec
+  setupL3G4200D(sensorRotationScaleDPS); // Configure L3G4200  - 250, 500 or 2000 deg/sec
 
   delay(1500); //wait for the sensor to be ready