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") { if (printing == "true") {
printerData.isPrinting = true; printerData.isPrinting = true;
} else { } 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.isPrinting = false;
} }
printerData.toolTemp = (const char*)root2["temperature"]["tool0"]["actual"]; printerData.toolTemp = (const char*)root2["temperature"]["tool0"]["actual"];

View File

@ -197,6 +197,11 @@ static const char COLOR_THEMES[] PROGMEM = "<option>red</option>"
void setup() { void setup() {
// Play a test beep
tone(D6, 450);
delay(250);
noTone(D6);
Serial.begin(115200); Serial.begin(115200);
SPIFFS.begin(); SPIFFS.begin();
delay(10); delay(10);