/* Reference:
* https://docs.arduino.cc/learn/electronics/lcd-displays
* https://wokwi.com/arduino/projects/322062421191557714
*/
#include <LiquidCrystal.h>
#include <TinyDebug.h>
#define Serial Debug
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(5, 4, 3, 2, 1, 0);
/* The circuit:
* LCD RS pin to digital pin 5
* LCD Enable pin to digital pin 4
* LCD D4 pin to digital pin 3
* LCD D5 pin to digital pin 2
* LCD D6 pin to digital pin 1
* LCD D7 pin to digital pin 0
* LCD R/W pin to ground
* 10K resistor:
* ends to +5V and ground
* wiper to LCD VO pin (pin 3)
*/
void setup() {
Serial.begin();
char *hello = "Hello, Wokwi!";
Serial.println(String(hello));
// set up the LCD's number of rows and columns:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print(String(hello));
}
void loop() {
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(6, 1);
// print the number of seconds since reset:
lcd.print(millis()/1000);
}