Display librairy manage 3 LED and a TextLCD (on, off, flash) (print message, clear)
Display Class Reference
This class manage 3 LED and 1 TextLCD display. More...
#include <Display.h>
Public Types | |
enum | choiceStatusLED { on, off, flash } |
use by printMessage() and changeStatusLed() More... | |
Public Member Functions | |
Display (PinName pinGreenLED, PinName pinRedLED, PinName pinOrangeLED, PinName pinLCDrs, PinName pinLCDe, PinName pinLCDd0, PinName pinLCDd1, PinName pinLCDd2, PinName pinLCDd3) | |
Create a Display interface (default : 16X2 screen) | |
Display (PinName pinGreenLED, PinName pinRedLED, PinName pinOrangeLED, PinName pinLCDrs, PinName pinLCDe, PinName pinLCDd0, PinName pinLCDd1, PinName pinLCDd2, PinName pinLCDd3, TextLCD::LCDType typeScreen) | |
Create a Display interface. | |
~Display (void) | |
Destructor. | |
void | printMessage (string message, choiceStatusLED statusGreenLED, choiceStatusLED statusRedLED, choiceStatusLED statusOrangeLED) |
print message on LCD screen and change status of green, red and orange LED. | |
void | clear (void) |
put off 3 LED and clear LCD screen |
Detailed Description
This class manage 3 LED and 1 TextLCD display.
She permit to print messages and to light or flash LED.
#include "mbed.h" #include "Display.h" Display disp(p12, p13, p14, p15, p16, p5, p6, p7, p8); // greenLED, redLED, orangeLED, LCD : rs, e, d4-d7 (default : 16X2 screen) float delay = 3; int main() { // print "HelloWorld !" on LCD screen and put on greenLED, flash redLED and put off orangeLED disp.printMessage("Hello World !", Display::on, Display::flash, Display::off); wait(delay); // print "coucou !" on LCD screen and put off greenLED, put on redLED and flash orangeLED disp.printMessage("coucou !", Display::off, Display::on, Display::flash); wait(delay); // print "bye bye !" on LCD screen and flash greenLED, put off redLED and put on orangeLED disp.printMessage("bye bye !", Display::flash, Display::off, Display::on); wait(delay); // clear LCD screen and shutdown 3 LED disp.clear(); }
Definition at line 53 of file Display.h.
Member Enumeration Documentation
enum choiceStatusLED |
use by printMessage() and changeStatusLed()
Constructor & Destructor Documentation
Display | ( | PinName | pinGreenLED, |
PinName | pinRedLED, | ||
PinName | pinOrangeLED, | ||
PinName | pinLCDrs, | ||
PinName | pinLCDe, | ||
PinName | pinLCDd0, | ||
PinName | pinLCDd1, | ||
PinName | pinLCDd2, | ||
PinName | pinLCDd3 | ||
) |
Create a Display interface (default : 16X2 screen)
- Parameters:
-
pinGreenLED greenLED broche pinRedLED redLED broche pinOrangeLED orangeLED broche pinLCDrs LCD Instruction/data control line pinLCDe LCD Enable line (clock) pinLCDd0-d3 LCD Data lines
Definition at line 13 of file Display.cpp.
Display | ( | PinName | pinGreenLED, |
PinName | pinRedLED, | ||
PinName | pinOrangeLED, | ||
PinName | pinLCDrs, | ||
PinName | pinLCDe, | ||
PinName | pinLCDd0, | ||
PinName | pinLCDd1, | ||
PinName | pinLCDd2, | ||
PinName | pinLCDd3, | ||
TextLCD::LCDType | typeScreen | ||
) |
Create a Display interface.
- Parameters:
-
pinGreenLED greenLED broche pinRedLED redLED broche pinOrangeLED orangeLED broche pinLCDrs LCD Instruction/data control line pinLCDe LCD Enable line (clock) pinLCDd0-d3 LCD Data lines typeScreen LCD Sets the panel size/addressing mode (default = LCD16x2)
Definition at line 30 of file Display.cpp.
~Display | ( | void | ) |
Destructor.
Definition at line 40 of file Display.cpp.
Member Function Documentation
void clear | ( | void | ) |
put off 3 LED and clear LCD screen
Definition at line 73 of file Display.cpp.
void printMessage | ( | string | message, |
choiceStatusLED | statusGreenLED, | ||
choiceStatusLED | statusRedLED, | ||
choiceStatusLED | statusOrangeLED | ||
) |
print message on LCD screen and change status of green, red and orange LED.
all line except the last line, have to finish by CRLF. Warning : CRLF count like a character. don't end message by CRLF. examples :
"this line have to finish by CRLF\/n and next too\/n but not the last"
- Parameters:
-
message message will be display on screen statusGreenLED new status of greenLED (on, off, flash) statusRedLED new status of redLED (on, off, flash) statusOrangeLED new status of orangeLED (on, off, flash)
Definition at line 53 of file Display.cpp.
Generated on Mon Aug 8 2022 14:17:56 by 1.7.2