Compare commits
2 commits
8f54104f5c
...
5edb208e01
Author | SHA1 | Date | |
---|---|---|---|
5edb208e01 | |||
8a7d7a4980 |
5 changed files with 73 additions and 4 deletions
|
@ -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);
|
||||||
|
}
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -16,6 +16,18 @@ switch ($_POST["cmd"]) {
|
||||||
case "cls":
|
case "cls":
|
||||||
fwrite($f, "CLS");
|
fwrite($f, "CLS");
|
||||||
break;
|
break;
|
||||||
|
case "on":
|
||||||
|
fwrite($f, "ON");
|
||||||
|
break;
|
||||||
|
case "off":
|
||||||
|
fwrite($f, "OFF");
|
||||||
|
break;
|
||||||
|
case "lcdon":
|
||||||
|
fwrite($f, "LCDON");
|
||||||
|
break;
|
||||||
|
case "lcdoff":
|
||||||
|
fwrite($f, "LCDOFF");
|
||||||
|
break;
|
||||||
case "line":
|
case "line":
|
||||||
fwrite($f, "LINE ");
|
fwrite($f, "LINE ");
|
||||||
fwrite($f, $_POST["line"]);
|
fwrite($f, $_POST["line"]);
|
||||||
|
|
|
@ -26,6 +26,26 @@ $Title = "MAPID-FIFO Web-UI";
|
||||||
<button type="submit">Clear</button>
|
<button type="submit">Clear</button>
|
||||||
</form>
|
</form>
|
||||||
</section>
|
</section>
|
||||||
|
<section>
|
||||||
|
<form action="command.php" method="POST">
|
||||||
|
<input type="hidden" name="cmd" value="on">
|
||||||
|
<button type="submit">LED On</button>
|
||||||
|
</form>
|
||||||
|
<form action="command.php" method="POST">
|
||||||
|
<input type="hidden" name="cmd" value="off">
|
||||||
|
<button type="submit">LED Off</button>
|
||||||
|
</form>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<form action="command.php" method="POST">
|
||||||
|
<input type="hidden" name="cmd" value="lcdon">
|
||||||
|
<button type="submit">Display On</button>
|
||||||
|
</form>
|
||||||
|
<form action="command.php" method="POST">
|
||||||
|
<input type="hidden" name="cmd" value="lcdoff">
|
||||||
|
<button type="submit">Display Off</button>
|
||||||
|
</form>
|
||||||
|
</section>
|
||||||
<section>
|
<section>
|
||||||
<form action="command.php" method="POST">
|
<form action="command.php" method="POST">
|
||||||
<input type="hidden" name="cmd" value="line">
|
<input type="hidden" name="cmd" value="line">
|
||||||
|
|
|
@ -20,6 +20,11 @@ section {
|
||||||
margin: 0 0 2em;
|
margin: 0 0 2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
form {
|
||||||
|
display: inline-block;
|
||||||
|
margin-right: .5em;
|
||||||
|
}
|
||||||
|
|
||||||
input, select {
|
input, select {
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
padding: 6px 14px;
|
padding: 6px 14px;
|
||||||
|
|
Loading…
Reference in a new issue