portable version of the cumulocity demo
Dependencies: C027_Support C12832 LM75B MMA7660 MbedSmartRest mbed-rtos mbed
Fork of MbedSmartRestMain by
DeviceIO.cpp@41:804f6a0bda26, 2014-07-15 (annotated)
- Committer:
- Cumulocity
- Date:
- Tue Jul 15 12:44:34 2014 +0000
- Revision:
- 41:804f6a0bda26
- Child:
- 46:f6976fd64387
refactoring of mbed agent
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Cumulocity | 41:804f6a0bda26 | 1 | #include "DeviceIO.h" |
Cumulocity | 41:804f6a0bda26 | 2 | |
Cumulocity | 41:804f6a0bda26 | 3 | DeviceIO::DeviceIO() : |
Cumulocity | 41:804f6a0bda26 | 4 | _temperatureSensor(SDA,SCL), |
Cumulocity | 41:804f6a0bda26 | 5 | _accelerometer(SDA,SCL), |
Cumulocity | 41:804f6a0bda26 | 6 | _lcd(D11, D13, D12, D7, D10) |
Cumulocity | 41:804f6a0bda26 | 7 | { |
Cumulocity | 41:804f6a0bda26 | 8 | } |
Cumulocity | 41:804f6a0bda26 | 9 | |
Cumulocity | 41:804f6a0bda26 | 10 | LM75B& DeviceIO::temperatureSensor() |
Cumulocity | 41:804f6a0bda26 | 11 | { |
Cumulocity | 41:804f6a0bda26 | 12 | return _temperatureSensor; |
Cumulocity | 41:804f6a0bda26 | 13 | } |
Cumulocity | 41:804f6a0bda26 | 14 | |
Cumulocity | 41:804f6a0bda26 | 15 | MMA7660& DeviceIO::accelerometer() |
Cumulocity | 41:804f6a0bda26 | 16 | { |
Cumulocity | 41:804f6a0bda26 | 17 | return _accelerometer; |
Cumulocity | 41:804f6a0bda26 | 18 | } |
Cumulocity | 41:804f6a0bda26 | 19 | |
Cumulocity | 41:804f6a0bda26 | 20 | void DeviceIO::lcdPrint(const char *line1, const char *line2, const char *line3) |
Cumulocity | 41:804f6a0bda26 | 21 | { |
Cumulocity | 41:804f6a0bda26 | 22 | _lcd.cls(); |
Cumulocity | 41:804f6a0bda26 | 23 | _lcd.locate(0, 0); |
Cumulocity | 41:804f6a0bda26 | 24 | _lcd.printf("%s\n", line1); |
Cumulocity | 41:804f6a0bda26 | 25 | if (line2 != NULL) { |
Cumulocity | 41:804f6a0bda26 | 26 | _lcd.printf("%s\n", line2); |
Cumulocity | 41:804f6a0bda26 | 27 | if (line3 != NULL) |
Cumulocity | 41:804f6a0bda26 | 28 | _lcd.printf("%s\n", line3); |
Cumulocity | 41:804f6a0bda26 | 29 | } |
Cumulocity | 41:804f6a0bda26 | 30 | } |