Added Piezo Buzzer Support

Adds piezo buzzer support to pin D6 to play a tone when a print is completed.
pull/153/head
Cashton Harmer 2021-11-28 20:35:13 -06:00
parent bd8422b228
commit 7f932b38f3
2 changed files with 16 additions and 1 deletions

View File

@ -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"];

View File

@ -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);