This program is an advanced "IoT" thermometer using LM75B component library. It displays the current value to the Serial host in Celcius or Fahrenheit (possible to change using a switch). It also stores an historic and displays it to the user using the LCD screen. Moreover, you can change the orientation of the screen by turning the device, just like a smartphone.
Dependencies: C12832 FXOS8700CQ LM75B mbed
Diff: ThermalDisplayer.cpp
- Revision:
- 3:a4dac093a968
- Parent:
- 2:5d0c209e5c61
- Child:
- 4:5bf99eb2d740
diff -r 5d0c209e5c61 -r a4dac093a968 ThermalDisplayer.cpp --- a/ThermalDisplayer.cpp Wed Feb 10 01:01:54 2016 +0000 +++ b/ThermalDisplayer.cpp Wed Feb 10 01:41:39 2016 +0000 @@ -22,16 +22,20 @@ /* * Display informations to the LCD screen - * Screen if flusing and flashing everytime but this is the only way to secure data integrity. + * Screen isn't even flusing ! */ void ThermalDisplayer::display() { list<float>::const_iterator it; - this->lcd->cls(); int pos = 0; for (it = this->temperatures.begin(); it != this->temperatures.end(); it++, pos++) { int height = (int) (32 * ((*it) - this->minScale) / (this->maxScale - this->minScale)); + /* + * Draw a white rectangle to erase previous data. + * Then, draw again. + */ + this->lcd->rect(pos * 2, 0, pos * 2 + 1, 32, 0); this->lcd->rect(pos * 2, height < 0 ? 31 : 32 - height, pos * 2 + 1, 32, 1); } }