Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: C027_Support C12832 LM75B MMA7660 MbedSmartRest mbed-rtos mbed
Fork of MbedSmartRestMain by
measurement/Temperature.h
- Committer:
- xinlei
- Date:
- 2016-08-08
- Revision:
- 139:f8ab852e83e7
- Parent:
- 137:a52821cdb108
File content as of revision 139:f8ab852e83e7:
#ifndef TEMPERATURE_H
#define TEMPERATURE_H
#include "mbed.h"
#include "LM75B.h"
#include "AbstractReporter.h"
class Temperature: public AbstractReporter
{
public:
Temperature(): deviceReady(false), oldValue(0),
timer(), sensor(D14, D15) {
timer.start();
}
virtual ~Temperature() {}
virtual bool init() {
deviceReady = sensor.open();
return deviceReady;
}
virtual const char* name() const { return "Temp"; }
virtual int read(char*, size_t, char*, size_t);
private:
bool deviceReady;
float oldValue;
Timer timer;
LM75B sensor;
};
#endif /* TEMPERATURE_H */

Cumulocity