Hackster is hosting Hackster Holidays, Ep. 6: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Monday!Stream Hackster Holidays, Ep. 6 on Monday!
guptaaryan1010
Published

Easiest way to connect LCD screen to Arduino mega!

NO wires are required, This makes it interesting. (without I2c module).

BeginnerFull instructions provided11,274
Easiest way to connect LCD screen to Arduino mega!

Things used in this project

Hardware components

Arduino Mega 2560
Arduino Mega 2560
×1
Alphanumeric LCD, 16 x 2
Alphanumeric LCD, 16 x 2
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Circuit connection.

Wires are just to Indicate. Not needed actually.

Code

The code

C/C++
Just upload it. remove the part of code to print to get a snippet
#include <LiquidCrystal.h>

// initialize the library by associating any needed LCD interface pin
// with the arduino pin number it is connected to
const int rs = A3, en = A5, d4 = A9, d5 = A10, d6 = A11, d7 = A12;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

void setup() {
  pinMode(A14,OUTPUT);
  pinMode(A13,OUTPUT);
   pinMode(A4,OUTPUT);
   pinMode(A0,OUTPUT);
   pinMode(A2,OUTPUT);
   pinMode(A1,OUTPUT);
   
  digitalWrite(A14,LOW); 
  digitalWrite(A13,HIGH); 
   digitalWrite(A4,LOW); 
   digitalWrite(A0,LOW);
   digitalWrite(A2,LOW);
   digitalWrite(A1,HIGH);
   
  lcd.begin(16, 2);
  // Print a message to the LCD.
  lcd.print("Hello, World!");

}

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

Credits

guptaaryan1010

guptaaryan1010

1 project • 1 follower

Comments