diff --git a/src/buzzer.cpp b/src/buzzer.cpp deleted file mode 100644 index 014f740..0000000 --- a/src/buzzer.cpp +++ /dev/null @@ -1,5 +0,0 @@ -const int buzzerPin = 9; - -void setup() { - pinMode(buzzerPin, OUTPUT_LOW); -} \ No newline at end of file diff --git a/src/display.cpp b/src/realMain.cpp similarity index 77% rename from src/display.cpp rename to src/realMain.cpp index 3df3c70..f78ea67 100644 --- a/src/display.cpp +++ b/src/realMain.cpp @@ -8,7 +8,7 @@ const char *password = "zwr33htm"; const char *mqtt_server = "192.168.24.215"; -// set the LCD number of columns and rows +const int buzzerPin = D0; int lcdColumns = 16; int lcdRows = 2; @@ -18,13 +18,21 @@ LiquidCrystal_I2C lcd(0x3f, lcdColumns, lcdRows); void setup(){ lcd.init(); lcd.backlight(); + pinMode(buzzerPin, OUTPUT); } void loop(){ + // LCD // set cursor to first column, first row lcd.setCursor(0, 0); // print message lcd.print("Piss off, ghosts!"); // clears the display to print new message lcd.clear(); + + // buzzer + digitalWrite(buzzerPin, HIGH); + delay(1000); + digitalWrite(buzzerPin, LOW); + delay(1000); } \ No newline at end of file