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

include/TemperatureSensor.h

Committer:
co838_jls44
Date:
2017-02-24
Revision:
1:c54902f21aa8
Parent:
0:4b83b332b327

File content as of revision 1:c54902f21aa8:

/* 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_ */