17 pinMode(ANALOG7, INPUT);
18 PWR.setSensorPower(SENS_3V3,SENS_ON);
84 allsensors->
sensor1 = pitchRoll;
92 allsensors->
sensor2 = pitchRoll;
100 allsensors->
sensor3 = pitchRoll;
169 USB.print(F(
"ACC1X_"));
172 USB.print(F(
"ACC1Y_"));
175 USB.print(F(
"ACC1Z_"));
179 USB.print(F(
"ACC2X_"));
182 USB.print(F(
"ACC2Y_"));
185 USB.print(F(
"ACC2Z_"));
189 USB.print(F(
"ACC3X_"));
192 USB.print(F(
"ACC3Y_"));
195 USB.print(F(
"ACC3Z_"));
199 USB.print(F(
"POT_"));
200 USB.print(extension_);
205 USB.println(F(
"Error read sensors acc 1,2 and 3"));
217 USB.print(F(
"ACC1pitch"));
220 USB.print(F(
"ACC1roll"));
224 USB.print(F(
"ACC2pitch_"));
227 USB.print(F(
"ACC2roll_"));
231 USB.print(F(
"ACC3pitch_"));
234 USB.print(F(
"ACC3roll_"));
239 USB.print(F(
"POT_ "));
243 USB.print(F(
"Temp1_ "));
247 USB.print(F(
"Temp2_"));
251 USB.print(F(
"Temp3_"));
257 USB.println(F(
"Error read sensors"));
269 for(
int i = 0;i<30;i++)
271 buffer[i] = analogRead(ANALOG7);
274 extension = (int)(0.02981 *100* (1023-
median(30,buffer)));
319 return((x[n/2] + x[n/2 - 1]) / 2.0);
void print()
This method reads the X, Y and Z - Values of all 3 Accelerometers and the extensiomter and prints the...
void printAll()
This method reads all the sensors and prints them to the serial Port.
FXLS8471Q::structPitchRoll sensor3
void wakeUp()
This method is used to wake up the Sensors, it initializes them.
FXLS8471Q::structPitchRoll sensor1
#define RETURN_ERROR_Temp
void goToSleep()
This method sets the Temperature Sensor in shutdown mode.
uint8_t getSensorValues(Sensors::structSensors *allSensors)
This method reads the pitch and Roll Angle- Values of all 3 Accelerometers, all 3 temperatures and th...
void init(uint8_t slaveAddr)
This method initializes the temperature sensor PCT2075.
void goToSleep()
This method sets all sensors in Standby.
int median(int n, int x[])
This method calculates the median value of the elements in the array.
uint8_t getSensorAcc123(Sensors::structSensorsXYZ *sensors123)
This method gives back the X, Y and Z - Values of all 3 Accelerometers.
void goToSleep()
This method sets the Accelerometer in Standby.
Class that handles the communication to the Accelerometer FXLS8471Q.
void getExtension(int &extension)
This method reads the Extension of the potentiometer, it uses the 10Bit- ADC Converter it calculates...
uint8_t getAccXYZ(FXLS8471Q::structXYZ *xyz)
This method returns the values of the X, Y and Z axis of the Accelerometer FXLS8471Q.
uint8_t getAccPitchRoll(FXLS8471Q::structPitchRoll *PitchRoll)
This method returns the values of the pitch and roll angles of the Accelerometer FXLS8471Q.
FXLS8471Q::structPitchRoll sensor2
uint8_t getTemp(int8_t &Temp)
This method gets the temperatur value of the temperature sensor PCT2075.
void init()
This method initializes the sensors.
FXLS8471Q::structXYZ sensor2
FXLS8471Q::structXYZ sensor3
FXLS8471Q::structXYZ sensor1
void init(uint8_t slaveAddr)
This method initializes the Accelerometer FXLS8471Q.