#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2); // Change the address if needed
void setup() {
lcd.begin(16, 2);
lcd.backlight();
lcd.print("X: Y:");
// Add any other setup code you may need here
}
void loop() {
int xValue = analogRead(A0);
int yValue = analogRead(A1);
// Map the analog values to a range (if necessary)
xValue = map(xValue, 0, 1023, 0, 100);
yValue = map(yValue, 0, 1023, 0, 100);
// Clear the LCD and go to the start of the first line
lcd.clear();
lcd.setCursor(0, 0);
// Print the X and Y values
lcd.print("X: ");
lcd.print(xValue);
lcd.print("%");
lcd.setCursor(0, 1);
lcd.print("Y: ");
lcd.print(yValue);
lcd.print("%");
// Add any other code or processing here
delay(100); // Adjust the delay as needed for your application
}