Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: BMP280
Revision 17:95b0b1ec0f90, committed 2018-01-07
- Comitter:
- Swaggie
- Date:
- Sun Jan 07 00:06:48 2018 +0000
- Parent:
- 16:1b3488fb67f5
- Child:
- 18:dff5292d62a9
- Commit message:
- Removed unnecessary ticker and state from LCD class.
Changed in this revision
| LCD.cpp | Show annotated file Show diff for this revision Revisions of this file |
| LCD.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/LCD.cpp Sun Jan 07 00:02:29 2018 +0000
+++ b/LCD.cpp Sun Jan 07 00:06:48 2018 +0000
@@ -3,19 +3,15 @@
#include "TextLCD.h"
#include "rtos.h"
-EnviromLCDDisplay::EnviromLCDDisplay(PinName rs, PinName e, PinName d4, PinName d5, PinName d6, PinName d7, PinName Button1Pin, PinName Button2) : TextLCD(rs, e, d4, d5, d7, d7), _DisplayScroll(), _LCDThread(), _Button2(Button2)
+EnviromLCDDisplay::EnviromLCDDisplay(PinName rs, PinName e, PinName d4, PinName d5, PinName d6, PinName d7, PinName Button1Pin, PinName Button2) : TextLCD(rs, e, d4, d5, d7, d7), _LCDThread(), _Button2(Button2)
{
//Initialise all variables
_TState = MESSAGE;
- _SState = PRESTEMP;
_temperature = 0.0;
_pressure = 0.0;
_ldr = 0.0;
- _message = "";
- //_DisplayScroll = DisplayScroll;
- //_LCDThread = LCDThread;
+ _message = "";
_Button1Pin = Button1Pin;
- //_Button2 = Button2;
_AutoQuit = true;
}
@@ -54,7 +50,6 @@
if (_AutoQuit && (_TState == MESSAGE)) //Therefore button 1 interrupt won't be overwritten
{
_TState = SCROLLREADINGS; //Return to showing data
- _SState = PRESTEMP; //Go to screen 1
}
break;
case SCROLLREADINGS :
--- a/LCD.h Sun Jan 07 00:02:29 2018 +0000
+++ b/LCD.h Sun Jan 07 00:06:48 2018 +0000
@@ -16,10 +16,8 @@
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;
@@ -28,7 +26,6 @@
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
@@ -37,7 +34,6 @@
//private functions
void LCDThreadFn(void); //This needs to be attached to a thread
void TimeButtonISR(void); //Run when Button 1 is set as an interrupt in
- void DisplayScrollISR(void);//Run by ticker
public:
//public functions
EnviromLCDDisplay(PinName rs, PinName e, PinName d4, PinName d5, PinName d6, PinName d7, PinName Button1Pin, PinName Button2); //Constructor