Sensor Data - first assignment CO838
Dependencies: mbed C12832 FXOS8700Q LM75B eCompass_FPU_Lib
Sensor Data - Project developed by Jean-Paul Saysana (jls44)
First assignment for the Internet of Things and Mobile Devices CO838 module
University of Kent (2016-2017)
Functionalities:
- Temperature Sensor
- Compass
- Music box
- Potentiometer that changes LED colours
Libraries used: C12832, eCompass_FPU_Lib, FXOS8700Q, LM75B
Diff: include/TemperatureSensor.h
- Revision:
- 0:4b83b332b327
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/include/TemperatureSensor.h Fri Feb 24 11:25:05 2017 +0000 @@ -0,0 +1,46 @@ +/* Developed by Jean-Paul Saysana - jls44 - MSc Student in Computer Security*/ +/* Internet of Things and Mobile Devices - CO838 University of Kent*/ +/* + Class of the temperature sensor using the LM75B lib. + It can read read ambiant temperature in Celsius or Fahrenheit. +*/ + +#ifndef TEMPERATURESENSOR_H_ +#define TEMPERATURESENSOR_H_ + + +#include "mbed.h" +#include "LM75B/LM75B.h" + +class TemperatureSensor { +public: + TemperatureSensor(); + ~TemperatureSensor() {}; + + /* Read the ambiant temperature */ + float GetTemperature() const; + + /* Temperature different mode */ + enum eTemp { CELSIUS, FAHRENHEIT }; + + /* Get Temperature mode, either Celsius or Fahrenheit */ + eTemp GetMode() const; + + /* Set the mode in Celsius */ + void SetCelsius(); + /* Check if it's Celsius mode */ + bool IsCelsius(); + /* Set the mode in Fahrenheit */ + void SetFahrenheit(); + /* Check if it's Fahrenheit mode */ + bool IsFahrenheit(); + + /* Switch between Celsius or Fahrenheit */ + void SwitchMode(); + +private: + /* Mode of the temperature */ + eTemp temp_mode; +}; + +#endif /* TEMPERATURESENSOR_H_ */ \ No newline at end of file