merged display and buzzer files

comboLock
Jonas Wittstrøm 2 years ago
parent 82e379bff3
commit 46a4a8cfa1

@ -1,5 +0,0 @@
const int buzzerPin = 9;
void setup() {
pinMode(buzzerPin, OUTPUT_LOW);
}

@ -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);
}
Loading…
Cancel
Save