Lcd display

Dependencies:   mbed SerialLCD

Committer:
noamnahum
Date:
Mon Jun 07 21:36:58 2021 +0000
Revision:
3:4c564ed930fc
Parent:
2:5e42a3c4fd80
For ofek

Who changed what in which revision?

UserRevisionLine numberNew contents of line
noamnahum 0:c2b3b055cc8e 1 #include "mbed.h"
noamnahum 2:5e42a3c4fd80 2 #include "SerialLCD.h"
noamnahum 2:5e42a3c4fd80 3 SerialLCD lcd(PA_9);
noamnahum 2:5e42a3c4fd80 4 int main() {
noamnahum 2:5e42a3c4fd80 5 lcd.clear();
noamnahum 0:c2b3b055cc8e 6
noamnahum 2:5e42a3c4fd80 7 while(true) {
noamnahum 2:5e42a3c4fd80 8 /// Test code ///
noamnahum 2:5e42a3c4fd80 9 lcd.clearLine(1);
noamnahum 2:5e42a3c4fd80 10 lcd.printf("Full Bright Test");
noamnahum 2:5e42a3c4fd80 11 lcd.setBrightness(30);
noamnahum 2:5e42a3c4fd80 12 wait(3);
noamnahum 2:5e42a3c4fd80 13
noamnahum 2:5e42a3c4fd80 14 lcd.clearLine(1);
noamnahum 2:5e42a3c4fd80 15 lcd.printf("Blink Test");
noamnahum 2:5e42a3c4fd80 16 lcd.setCursor(2, 1);
noamnahum 2:5e42a3c4fd80 17 lcd.printf("Blinking");
noamnahum 2:5e42a3c4fd80 18 lcd.blink();
noamnahum 2:5e42a3c4fd80 19 wait(3);
noamnahum 2:5e42a3c4fd80 20
noamnahum 2:5e42a3c4fd80 21 lcd.clearLine(1);
noamnahum 2:5e42a3c4fd80 22 lcd.printf("Clear Test");
noamnahum 2:5e42a3c4fd80 23 wait(2);
noamnahum 2:5e42a3c4fd80 24 lcd.clear();
noamnahum 2:5e42a3c4fd80 25 wait(3);
noamnahum 2:5e42a3c4fd80 26
noamnahum 2:5e42a3c4fd80 27
noamnahum 2:5e42a3c4fd80 28 lcd.clearLine(1);
noamnahum 2:5e42a3c4fd80 29 lcd.printf("Cursor Test");
noamnahum 2:5e42a3c4fd80 30 lcd.setCursor(2, 1);
noamnahum 2:5e42a3c4fd80 31 lcd.cursor();
noamnahum 2:5e42a3c4fd80 32 wait(3);
noamnahum 0:c2b3b055cc8e 33
noamnahum 2:5e42a3c4fd80 34 lcd.clearLine(1);
noamnahum 2:5e42a3c4fd80 35 lcd.printf("Display Test");
noamnahum 2:5e42a3c4fd80 36 lcd.noDisplay();
noamnahum 2:5e42a3c4fd80 37 wait(2);
noamnahum 2:5e42a3c4fd80 38 lcd.display();
noamnahum 2:5e42a3c4fd80 39 wait(3);
noamnahum 2:5e42a3c4fd80 40
noamnahum 2:5e42a3c4fd80 41 lcd.clearLine(1);
noamnahum 2:5e42a3c4fd80 42 lcd.printf("Home Test");
noamnahum 2:5e42a3c4fd80 43 lcd.setCursor(2, 1);
noamnahum 2:5e42a3c4fd80 44 lcd.home();
noamnahum 2:5e42a3c4fd80 45 lcd.printf("Got home");
noamnahum 2:5e42a3c4fd80 46 wait(3);
noamnahum 2:5e42a3c4fd80 47
noamnahum 2:5e42a3c4fd80 48 lcd.leftToRight();
noamnahum 2:5e42a3c4fd80 49 lcd.clearLine(1);
noamnahum 2:5e42a3c4fd80 50 lcd.printf("LeftToRight Test");
noamnahum 2:5e42a3c4fd80 51 wait(3);
noamnahum 0:c2b3b055cc8e 52
noamnahum 2:5e42a3c4fd80 53 lcd.clearLine(1);
noamnahum 2:5e42a3c4fd80 54 lcd.printf("noBlink Test");
noamnahum 2:5e42a3c4fd80 55 lcd.setCursor(2, 1);
noamnahum 2:5e42a3c4fd80 56 lcd.noBlink();
noamnahum 2:5e42a3c4fd80 57 wait(3);
noamnahum 2:5e42a3c4fd80 58
noamnahum 2:5e42a3c4fd80 59 lcd.clearLine(1);
noamnahum 2:5e42a3c4fd80 60 lcd.printf("noCursor Test");
noamnahum 2:5e42a3c4fd80 61 lcd.setCursor(2, 1);
noamnahum 2:5e42a3c4fd80 62 lcd.noCursor();
noamnahum 2:5e42a3c4fd80 63 wait(3);
noamnahum 2:5e42a3c4fd80 64
noamnahum 2:5e42a3c4fd80 65 lcd.rightToLeft();
noamnahum 2:5e42a3c4fd80 66 lcd.clearLine(1);
noamnahum 2:5e42a3c4fd80 67 lcd.printf("rightToLeft Test");
noamnahum 2:5e42a3c4fd80 68 wait(3);
noamnahum 2:5e42a3c4fd80 69
noamnahum 2:5e42a3c4fd80 70 lcd.clearLine(1);
noamnahum 2:5e42a3c4fd80 71 lcd.printf("Half Bright Test");
noamnahum 2:5e42a3c4fd80 72 lcd.setBrightness(15);
noamnahum 2:5e42a3c4fd80 73 wait(3);
noamnahum 2:5e42a3c4fd80 74 }
noamnahum 0:c2b3b055cc8e 75 }