MAPID/CP: Added LCDON/LCDOFF

This commit is contained in:
Malte Bublitz 2023-10-26 20:43:47 +02:00
parent 8f54104f5c
commit 8a7d7a4980
Signed by: malte70
GPG key ID: 605DA5C729F9C184
2 changed files with 36 additions and 4 deletions

View file

@ -37,6 +37,9 @@ void setup() {
SCmd.addCommand("ON", ledOn); SCmd.addCommand("ON", ledOn);
SCmd.addCommand("OFF", ledOff); SCmd.addCommand("OFF", ledOff);
// LCD // LCD
SCmd.addCommand("LCDON", lcdOn);
SCmd.addCommand("LCDOFF", lcdOff);
SCmd.addCommand("ECHO", lcdEcho); SCmd.addCommand("ECHO", lcdEcho);
SCmd.addCommand("CLS", lcdClear); SCmd.addCommand("CLS", lcdClear);
SCmd.addCommand("LINE", lcdLine); SCmd.addCommand("LINE", lcdLine);
@ -171,11 +174,16 @@ void help() {
Serial.println(" VER"); Serial.println(" VER");
Serial.println(" GETTY"); Serial.println(" GETTY");
Serial.println(" HELP"); Serial.println(" HELP");
Serial.println(" CLS");
Serial.println(" ON"); Serial.println(" ON");
Serial.println(" OFF"); Serial.println(" OFF");
Serial.println(" LCDON");
Serial.println(" LCDOFF");
Serial.println(" ECHO Text"); Serial.println(" ECHO Text");
Serial.println(" CLS");
Serial.println(" LINE i"); Serial.println(" LINE i");
#ifdef README_PROGMEM
Serial.println(" README");
#endif
// Show prompt again // Show prompt again
Serial.println(); Serial.println();
@ -184,8 +192,8 @@ void help() {
void ledOn() { void ledOn() {
Serial.println(""); Serial.println("");
Serial.println("Turning LED to *ON*");
Serial.println("Turning LED to *ON*");
//lcd.println("LED on"); //lcd.println("LED on");
digitalWrite(PIN_LED, HIGH); digitalWrite(PIN_LED, HIGH);
@ -195,11 +203,35 @@ void ledOn() {
void ledOff() { void ledOff() {
Serial.println(""); Serial.println("");
Serial.println("Turning LED to *OFF*");
Serial.println("Turning LED to *OFF*");
//lcd.println("LED off"); //lcd.println("LED off");
digitalWrite(PIN_LED, LOW); digitalWrite(PIN_LED, LOW);
// Show prompt again // Show prompt again
Serial.print(TTY_PROMPT); Serial.print(TTY_PROMPT);
} }
void lcdOn() {
Serial.println("");
// Turn display on
Serial.println("Turning LCD screen to *ON*");
lcd.display();
lcd.setBrightness(30);
// Show prompt again
Serial.print(TTY_PROMPT);
}
void lcdOff() {
Serial.println("");
// Turn display on
Serial.println("Turning LCD screen to *OFF*");
lcd.noDisplay();
lcd.setBrightness(1);
// Show prompt again
Serial.print(TTY_PROMPT);
}

View file

@ -2,7 +2,7 @@
#define _CONFIG_H_ #define _CONFIG_H_
#define OS_NAME "MAPID/CP" #define OS_NAME "MAPID/CP"
#define OS_VERSION 4 #define OS_VERSION 5
#define PIN_LED LED_BUILTIN #define PIN_LED LED_BUILTIN
#define PIN_LCD 2 #define PIN_LCD 2