You are on page 1of 1

//#define LED_1_PIN 3

//#define pulsante 2

#include <LiquidCrystal_I2C.h>

#include <Wire.h>
#include <hd44780.h>
#include <hd44780ioClass/hd44780_I2Cexp.h> // i2c expander i/o class header

//LiquidCrystal_I2C lcd(0x27, 16, 2);

hd44780_I2Cexp lcd;

const int LCD_COLS = 16;


const int LCD_ROWS = 2;

void setup() {
// put your setup code here, to run once:
//pinMode(LED_1_PIN, OUTPUT);

/*lcd.init(); // initialize the lcd


lcd.backlight(); // Turn on backlight
lcd.print("hello, world!");// Print a message to the LCD*/

Serial.begin(115200);

int result = lcd.begin(LCD_COLS, LCD_ROWS);


if (result) {
Serial.print("LCD initialization failed: ");
Serial.println(result);
hd44780::fatalError(result);
}

lcd.print("Hello, Wokwi!");

void loop() {
// put your main code here, to run repeatedly:

/* byte buttonStateOre = digitalRead(pulsante);

if(buttonStateOre==HIGH){
digitalWrite(LED_1_PIN, HIGH);
}else{
digitalWrite(LED_1_PIN, LOW);
}

// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 1);// set the cursor to column 0, line 1
// print the number of seconds since reset:
lcd.print("Counter:");
lcd.print(millis() / 1000);
*/
}

You might also like