With this libary you can read the I2C tempsensor off the appboard.
TemperatureSensor.cpp
- Committer:
- de_geeter_alexander
- Date:
- 2015-12-25
- Revision:
- 0:1a9f04f52745
File content as of revision 0:1a9f04f52745:
#include "MbedJSONValue.h" #include "TemperatureSensor.h" TemperatureSensor::TemperatureSensor(PinName SDA, PinName SCL, std::string key, std::string name) : LM75B(SDA, SCL) { this->key=key; this->name=name; } std::string TemperatureSensor::getDataPacket(void) { char buffer[100]; MbedJSONValue jstring; jstring["data"][0]=name; jstring["data"][1]=key; jstring["data"][2]=temp(); std::string s = jstring.serialize(); return s; }