fuck this
Dependencies: BMP280
Diff: LCD.h
- Revision:
- 22:617bf92b481f
- Parent:
- 21:6e733076f49c
- Child:
- 23:a6bb5298346c
--- a/LCD.h Tue Jan 09 20:51:19 2018 +0000 +++ b/LCD.h Wed Jan 10 00:32:08 2018 +0000 @@ -32,21 +32,38 @@ float _latestPres; float _latestLDR; time_t _latestTime; - - enum ThreadState{MESSAGE,SCROLLREADINGS,ADJUSTTIME}; - + + enum ThreadState {MESSAGE,SCROLLREADINGS,ADJUSTTIME}; + ThreadState _currentState; //State machine state - + //Hardware InterruptIn Button1; //Buttons used for setting time - DigitalIn Button2; + InterruptIn Button2; + Timeout But1Debouncer;//Button debouncers + Timeout But2Debouncer; Thread LCDThread; //Thread which LCD runs in - + void Button1ISR(void); - //Called when button 1 is pressed. + //Called when button 1 is pressed. + void But1DebouncerISR(void); + //insures that only 1 button press signal is sent to thread + void Button2ISR(void); + //Called when button 2 is pressed. Sets _but2Pressed and thread flag + void But2DebouncerISR(void); + //insures that only 1 button press signal is sent to thread void StateMachine(void); //Gets attached to LCDThread - + int TimeEditor(int changingVal, int upperLimit, int lowerLimit); + //Handles the cycle and user input to modify changingVal and return the updated number + + //Used for time editing + bool _but1Pressed; //Signals that button 1 has been pressed + bool _but2Pressed; //Signals that button 2 has been pressed + tm _EditTime; //used to hold time structure whilst editing + char _editingInTime[10];//hold the string of what variable is to be edited + + public: ENVDISPLAY(PinName rsPin, PinName rePin, PinName d4Pin, PinName d5Pin, PinName d6Pin, PinName d7Pin, PinName Button1Pin, PinName Button2Pin); //constructor @@ -56,7 +73,7 @@ //Inititates LCD activity void UpdateData(float temp, float pres, float LDR, time_t sampleTime); //Pass in new enviromental data - + }; extern ENVDISPLAY lcd;