Added Piezo Buzzer Support
Adds piezo buzzer support to pin D6 to play a tone when a print is completed.pull/153/head
parent
bd8422b228
commit
7f932b38f3
|
|
@ -237,6 +237,16 @@ void OctoPrintClient::getPrinterJobResults() {
|
|||
if (printing == "true") {
|
||||
printerData.isPrinting = true;
|
||||
} else {
|
||||
if (printerData.isPrinting) {
|
||||
// Print complete chime
|
||||
tone(D6, 450);
|
||||
delay(250);
|
||||
noTone(D6);
|
||||
delay(250);
|
||||
tone(D6, 450);
|
||||
delay(250);
|
||||
noTone(D6);
|
||||
}
|
||||
printerData.isPrinting = false;
|
||||
}
|
||||
printerData.toolTemp = (const char*)root2["temperature"]["tool0"]["actual"];
|
||||
|
|
|
|||
|
|
@ -196,7 +196,12 @@ static const char COLOR_THEMES[] PROGMEM = "<option>red</option>"
|
|||
"<option>w3schools</option>";
|
||||
|
||||
|
||||
void setup() {
|
||||
void setup() {
|
||||
// Play a test beep
|
||||
tone(D6, 450);
|
||||
delay(250);
|
||||
noTone(D6);
|
||||
|
||||
Serial.begin(115200);
|
||||
SPIFFS.begin();
|
||||
delay(10);
|
||||
|
|
|
|||
Loading…
Reference in New Issue