portable version of the cumulocity demo
Dependencies: C027_Support C12832 LM75B MMA7660 MbedSmartRest mbed-rtos mbed
Fork of MbedSmartRestMain by
Diff: DeviceIO.cpp
- Revision:
- 41:804f6a0bda26
- Child:
- 46:f6976fd64387
diff -r 13c24225f189 -r 804f6a0bda26 DeviceIO.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/DeviceIO.cpp Tue Jul 15 12:44:34 2014 +0000 @@ -0,0 +1,30 @@ +#include "DeviceIO.h" + +DeviceIO::DeviceIO() : + _temperatureSensor(SDA,SCL), + _accelerometer(SDA,SCL), + _lcd(D11, D13, D12, D7, D10) +{ +} + +LM75B& DeviceIO::temperatureSensor() +{ + return _temperatureSensor; +} + +MMA7660& DeviceIO::accelerometer() +{ + return _accelerometer; +} + +void DeviceIO::lcdPrint(const char *line1, const char *line2, const char *line3) +{ + _lcd.cls(); + _lcd.locate(0, 0); + _lcd.printf("%s\n", line1); + if (line2 != NULL) { + _lcd.printf("%s\n", line2); + if (line3 != NULL) + _lcd.printf("%s\n", line3); + } +}