fuck this

Dependencies:   BMP280

Revision:
15:e61297f9bae9
Parent:
14:1fb1354ac27c
Child:
16:1b3488fb67f5
--- a/LCD.h	Sat Jan 06 16:13:37 2018 +0000
+++ b/LCD.h	Sat Jan 06 22:54:42 2018 +0000
@@ -1,6 +1,53 @@
 #ifndef __LCD__
 #define __LCD__
-
+/*
+*This class inherits the TextLCD class to add functionality to display enviromental readings,
+*with a scrolling display, or to display a specific message, which times out back
+*to scrolling, and to set the time using two push buttons.
+*/
+#include "mbed.h"
+#include "TextLCD.h"
+#include "rtos.h"
+#include <string>
 //These functions manage writing to the LCD
 
+class EnviromLCDDisplay : private TextLCD
+{
+private:
+    //private variables
+    enum ThreadState{MESSAGE,SCROLLREADINGS,ADJUSTTIME};
+    enum ScrollState{PRESTEMP,LDRTIME};
+    
+    ThreadState _TState;    //This determines what function the LCD is doing
+    ScrollState _SState;    //This determines what screen on the LCD is shown
+    
+    //Values to display    
+    float _temperature;
+    float _pressure;
+    float _ldr;
+    string _message;
+    
+    //Objects to be used
+    Ticker _DisplayScroll;  //pointer to an external ticker that will be used for changing the display
+    Thread _LCDThread;         //Pointer to the therad that will be used for the LCD
+    PinName _Button1Pin;    //Button will change between InterruptIn and DigitalIn. Used to enter time edit mode
+    DigitalIn _Button2;  //Button2
+    bool _AutoQuit;     //After message is displayed, should LCD return to SCROLLREADINGS?
+    
+    //private functions
+    
+public:
+    //public functions
+    EnviromLCDDisplay(PinName rs,PinName e, PinName d4, PinName d5, PinName d6, PinName d7, PinName Button1Pin, PinName Button2/*, Thread& LCDThread, Ticker& DisplayScroll*/);    //Constructor
+    //~EnviromLCDDisplay();   //Destructor
+    
+    bool POST(void);    //Power On Self Test. Returns true if pass
+    void Start(void);   //Starts thread
+    
+    void DispMessage(string message, bool returnToReadings);   //Display given message on screen
+    void LCDThread(void);   //This needs to be attached to a thread
+    
+};
+
+
 #endif
\ No newline at end of file