From 1b39cb59e5c8cfad2ed1372cec86a8dbdd2dae17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Wittstr=C3=B8m?= Date: Mon, 14 Aug 2023 12:58:54 +0200 Subject: [PATCH] display works --- platformio.ini | 1 + src/display.cpp | 30 ++++++++++++++++++++++++++++++ src/{main.cpp => main.cpp.dis} | 0 3 files changed, 31 insertions(+) create mode 100644 src/display.cpp rename src/{main.cpp => main.cpp.dis} (100%) diff --git a/platformio.ini b/platformio.ini index 7bdceac..5fcf6d5 100644 --- a/platformio.ini +++ b/platformio.ini @@ -17,3 +17,4 @@ monitor_speed = 115200 lib_deps = knolleary/PubSubClient@^2.8 bblanchon/ArduinoJson@^6.21.3 + marcoschwartz/LiquidCrystal_I2C@^1.1.4 diff --git a/src/display.cpp b/src/display.cpp new file mode 100644 index 0000000..3df3c70 --- /dev/null +++ b/src/display.cpp @@ -0,0 +1,30 @@ +#include +#include +#include +#include + +const char *ssid = "PET Aflytningsvogn #43"; +const char *password = "zwr33htm"; + +const char *mqtt_server = "192.168.24.215"; + +// set the LCD number of columns and rows +int lcdColumns = 16; +int lcdRows = 2; + +// set LCD address, number of columns and rows +LiquidCrystal_I2C lcd(0x3f, lcdColumns, lcdRows); + +void setup(){ + lcd.init(); + lcd.backlight(); +} + +void loop(){ + // 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(); +} \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp.dis similarity index 100% rename from src/main.cpp rename to src/main.cpp.dis