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

Committer:
co838_gtvl2
Date:
Wed Feb 10 16:48:55 2016 +0000
Revision:
4:5bf99eb2d740
Parent:
2:5d0c209e5c61
Child:
6:6c61186c8739
WOW !; Speed of display x100 and ability to reverse screen using accelerometer !

Who changed what in which revision?

UserRevisionLine numberNew contents of line
co838_gtvl2 1:06713d1b69cf 1 #ifndef _THERMALDISPLAYER_H_
co838_gtvl2 1:06713d1b69cf 2 # define _THERMALDISPLAYER_H_
co838_gtvl2 1:06713d1b69cf 3
co838_gtvl2 1:06713d1b69cf 4 # include "main.h"
co838_gtvl2 1:06713d1b69cf 5 # include <list>
co838_gtvl2 1:06713d1b69cf 6 # include <iterator>
co838_gtvl2 1:06713d1b69cf 7
co838_gtvl2 2:5d0c209e5c61 8 class ThermalDisplayer
co838_gtvl2 2:5d0c209e5c61 9 {
co838_gtvl2 1:06713d1b69cf 10 public:
co838_gtvl2 1:06713d1b69cf 11 ThermalDisplayer();
co838_gtvl2 1:06713d1b69cf 12 void addTemp(const float&);
co838_gtvl2 1:06713d1b69cf 13 void display();
co838_gtvl2 4:5bf99eb2d740 14 void adjustScale(Serial&);
co838_gtvl2 1:06713d1b69cf 15 private:
co838_gtvl2 1:06713d1b69cf 16 static const int MAX_SIZE = 64;
co838_gtvl2 4:5bf99eb2d740 17 static const int DISPLAY_X = 127;
co838_gtvl2 4:5bf99eb2d740 18 static const int DISPLAY_Y = 31;
co838_gtvl2 2:5d0c209e5c61 19 static const int MIN_MIN_SCALE = 0;
co838_gtvl2 2:5d0c209e5c61 20 static const int MAX_MIN_SCALE = 20;
co838_gtvl2 2:5d0c209e5c61 21 static const int MIN_MAX_SCALE = 30;
co838_gtvl2 2:5d0c209e5c61 22 static const int MAX_MAX_SCALE = 50;
co838_gtvl2 1:06713d1b69cf 23 std::list<float> temperatures;
co838_gtvl2 1:06713d1b69cf 24 C12832 *lcd; // LCD screen
co838_gtvl2 2:5d0c209e5c61 25 AnalogIn pot; // Potentiometer POT2 to adjust the graphic's scale
co838_gtvl2 4:5bf99eb2d740 26 FXOS8700CQ accel;
co838_gtvl2 2:5d0c209e5c61 27 int minScale;
co838_gtvl2 2:5d0c209e5c61 28 int maxScale;
co838_gtvl2 4:5bf99eb2d740 29 bool screenOrientation;
co838_gtvl2 1:06713d1b69cf 30 };
co838_gtvl2 1:06713d1b69cf 31
co838_gtvl2 1:06713d1b69cf 32
co838_gtvl2 1:06713d1b69cf 33 #endif /* _THERMALDISPLAYER_H_ */