grove (TTC03 Thermistor) Temperature sensor class
Spaniakos - grove (TTC03 Thermistor) Temperature sensor class
Public Member Functions | Private Attributes | List of all members
TempSensor Class Reference

#include <TempSensor.h>

Public Member Functions

 TempSensor (uint8_t pin, float Thres)
 TempSensor (uint8_t pin)
void begin (void)
void Read_Temperature (void)
float Sensor_to_Temp (void)
void Save_Old (void)
int cmp_values (void)
float Value (void)
float Old_Value (void)
void CalcRensor ()
float get_Rensor ()
float get_Threshold ()
void calibrate ()

Private Attributes

uint8_t pinTemp
float temperature
unsigned int sensorValue
float Old_temperature
float Rensor
float TempeThres

Detailed Description


Constructor & Destructor Documentation

TempSensor::TempSensor ( uint8_t  pin,
float  Thres 

class constructor.

pinuint8_t Number of the pin to be used for reading
Thresfloat value of the threshold that will be used
TempSensor::TempSensor ( uint8_t  pin)

class constructor.

Threasold initializes to 0,10.

pinuint8_t Number of the pin to be used for reading

Member Function Documentation

void TempSensor::begin ( void  )

Initialized the base grove class with the balues given in the constructor.

void TempSensor::Read_Temperature ( void  )

reads value from sensor. the value is saved to sensorValue

float TempSensor::Sensor_to_Temp ( void  )

Reads the Value from the pin using

Calculates the Rensor using

end Saves the temperature value.

void TempSensor::Save_Old ( void  )

set Old_temperature equal to current temperature.

int TempSensor::cmp_values ( void  )

compare temperature and OLD_temperature values.

int 0 if equal , 1 if not
float TempSensor::Value ( void  )

Gets the Temperature valule.

temperature value.
float TempSensor::Old_Value ( void  )

get the Old_temperature value.

OLD_temperature value.
void TempSensor::CalcRensor ( )

Calculate the Rensor. The value is saved inside the class.

float TempSensor::get_Rensor ( )

GETS the Rensor value.

Rensor value.
float TempSensor::get_Threshold ( )

Gets the Threshold.

TempeThres as integer
void TempSensor::calibrate ( )

calibrate the sensor and readings. Does initial readings in order to calibrate the sensor.

Member Data Documentation

uint8_t TempSensor::pinTemp

holds the Pin number of the board

float TempSensor::temperature

holds the temperature value after the convertion from te reading

unsigned int TempSensor::sensorValue

holds the reading value from the sensor

float TempSensor::Old_temperature

holds the old temperature value, mainly used from cmp_values

float TempSensor::Rensor

holds the rensor value

float TempSensor::TempeThres

hold the Threshold, mainly used from cmp_values