dadbod
Published © GPL3+

Arduino Joystick to LCD Display

Using the Arduino Uno R3 to read input from an analog joystick, then display X, Y coordinates to an LCD screen

IntermediateShowcase (no instructions)1,944
Arduino Joystick to LCD Display

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Rotary potentiometer (generic)
Rotary potentiometer (generic)
This is to control the brightness of the LCD, I used a 10 Kohm pot for this project
×1
Jumper wires (generic)
Jumper wires (generic)
×20
Standard LCD - 16x2 White on Blue
Adafruit Standard LCD - 16x2 White on Blue
×1

Story

Read more

Schematics

Arduino Joystick to LCD Fritz

Fritizing file

Circuit Screenshot

Code

joystick1.ino

Arduino
//Matthew Tier Joystick LCD Display 12/19/2022
#include <LiquidCrystal.h>
#define joyX A0
#define joyY A1

const int rs =  12, en = 11, d4 = 7, d5 = 6, d6 = 5, d7 =4;//defining the pins for the LCD
int xValue, yValue;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

void setup() 
{
  lcd.begin(16, 2);//Starting LCD
  Serial.begin(9600);//Starting Serial for Joystick
  lcd.print("Hello!");
  delay(2000);
  lcd.clear();

}

void loop() 
{
  xValue = analogRead(joyX);//Reading X and Y values from joystick
  yValue = analogRead(joyY);
    
  lcd.setCursor(0,0);
  lcd.print("X Value : ");
  lcd.print(xValue);//Displaying xValue on top
  
  lcd.setCursor(0,1);
  lcd.print("Y Value : ");
  lcd.print(yValue);//Displaying yValue on bottom

  delay(500);
  lcd.clear();

}

Credits

dadbod

dadbod

0 projects • 1 follower

Comments