Rock Monitoring  V 1.0
Sensors Class Reference

Class that handles sensors. More...

#include <Sensors.h>

Collaboration diagram for Sensors:
Collaboration graph

Classes

struct  structSensors
 
struct  structSensorsPitchRoll
 
struct  structSensorsXYZ
 

Public Member Functions

 Sensors ()
 
void init ()
 This method initializes the sensors. More...
 
uint8_t getSensorAcc123 (Sensors::structSensorsXYZ *sensors123)
 This method gives back the X, Y and Z - Values of all 3 Accelerometers. More...
 
uint8_t getSensorValues (Sensors::structSensors *allSensors)
 This method reads the pitch and Roll Angle- Values of all 3 Accelerometers, all 3 temperatures and the extension
It reads the temperatures and accelerations as 16bit int but concluding 2 places after comma
the extension is given in 8 bit concluding the data in 1/10 mm. More...
 
void print ()
 This method reads the X, Y and Z - Values of all 3 Accelerometers and the extensiomter and prints them to the serial Port. More...
 
void printAll ()
 This method reads all the sensors and prints them to the serial Port. More...
 
void getExtension (int &extension)
 This method reads the Extension of the potentiometer, it uses the 10Bit- ADC Converter
it calculates the extension in 1/10 mm with the median value of 30 measurements. More...
 
void goToSleep ()
 This method sets all sensors in Standby. More...
 
void wakeUp ()
 This method is used to wake up the Sensors, it initializes them. More...
 

Private Member Functions

int median (int n, int x[])
 This method calculates the median value of the elements in the array. More...
 

Private Attributes

FXLS8471Q acc1
 
FXLS8471Q acc2
 
FXLS8471Q acc3
 
PCT2075 temp1
 
PCT2075 temp2
 
PCT2075 temp3
 

Detailed Description

Class that handles sensors.

Definition at line 12 of file Sensors.h.

Constructor & Destructor Documentation

Sensors::Sensors ( )

Definition at line 6 of file Sensors.cpp.

Member Function Documentation

void Sensors::getExtension ( int &  extension)

This method reads the Extension of the potentiometer, it uses the 10Bit- ADC Converter
it calculates the extension in 1/10 mm with the median value of 30 measurements.

Parameters
int& extension, Reference to int which contains the extension value (from 0 - 1023)

Definition at line 265 of file Sensors.cpp.

uint8_t Sensors::getSensorAcc123 ( Sensors::structSensorsXYZ sensors123)

This method gives back the X, Y and Z - Values of all 3 Accelerometers.

Parameters
Sensors::structSensorsXYZ* sensors123, Pointer to struct which contains data of all 3 acc. sensors
Returns
uint8_t state, gives back 1 for Error and 0 for ok

Definition at line 35 of file Sensors.cpp.

uint8_t Sensors::getSensorValues ( Sensors::structSensors allsensors)

This method reads the pitch and Roll Angle- Values of all 3 Accelerometers, all 3 temperatures and the extension
It reads the temperatures and accelerations as 16bit int but concluding 2 places after comma
the extension is given in 8 bit concluding the data in 1/10 mm.

Parameters
Sensors::structSensorsPitchRoll* sensors123, Pointer to struct which contains angle data of all 3 acc. sensors
Returns
uint8_t state, gives back 1 for Error with Accelerometer, 2 for Error with TempSensors and 0 for ok

Definition at line 77 of file Sensors.cpp.

void Sensors::goToSleep ( )

This method sets all sensors in Standby.

Definition at line 278 of file Sensors.cpp.

void Sensors::init ( void  )

This method initializes the sensors.

Definition at line 15 of file Sensors.cpp.

int Sensors::median ( int  n,
int  x[] 
)
private

This method calculates the median value of the elements in the array.

Parameters
intn, int x[], n = number of values in the array, x = array with values
Returns
int median, median value of the values in the array

Definition at line 299 of file Sensors.cpp.

void Sensors::print ( )

This method reads the X, Y and Z - Values of all 3 Accelerometers and the extensiomter and prints them to the serial Port.

Definition at line 161 of file Sensors.cpp.

void Sensors::printAll ( )

This method reads all the sensors and prints them to the serial Port.

Definition at line 212 of file Sensors.cpp.

void Sensors::wakeUp ( void  )

This method is used to wake up the Sensors, it initializes them.

Definition at line 289 of file Sensors.cpp.

Member Data Documentation

FXLS8471Q Sensors::acc1
private

Definition at line 57 of file Sensors.h.

FXLS8471Q Sensors::acc2
private

Definition at line 58 of file Sensors.h.

FXLS8471Q Sensors::acc3
private

Definition at line 59 of file Sensors.h.

PCT2075 Sensors::temp1
private

Definition at line 60 of file Sensors.h.

PCT2075 Sensors::temp2
private

Definition at line 61 of file Sensors.h.

PCT2075 Sensors::temp3
private

Definition at line 62 of file Sensors.h.


The documentation for this class was generated from the following files: