//// i2c////
// new code chart gpt //
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
// Set the I2C address of your LCD module
#define I2C_ADDRESS 0x27
// Set the LCD dimensions (change according to your display)
#define LCD_COLUMNS 16
#define LCD_ROWS 2
// Create an LCD object
LiquidCrystal_I2C lcd(I2C_ADDRESS, LCD_COLUMNS, LCD_ROWS);
void setup() {
Serial.begin(115200);
// Initialize the LCD
lcd.begin(LCD_COLUMNS, LCD_ROWS);
// Initalise the LCD
lcd.init();
lcd.backlight();
Serial.println("I2C LCD Example");
}
void loop() {
// Display a simple message
lcd.setCursor(0, 0);
lcd.print("Hello, Wokwi!");
delay(2000);
// Clear the display
lcd.clear();
delay(1000);
}