HelloWorld | Arduino UNO | LCD

by AndronikosKostas in Circuits > Arduino

274 Views, 4 Favorites, 0 Comments

HelloWorld | Arduino UNO | LCD

Componets_1.jpg
Componets_2.jpg

COMPONENTS :

- An Arduino Uno

- A LCD 19x4, 5V (16 pins)

- A IIC/I2C module (16 pins /4 pins )

- 4x Male to female cables

Why we use the I2C module and not just the LCD monitor?

Because we save 12 cables. Our life will be easier!

Coding_I2C Scanner

ConnectingArduinoToPc.JPG
#include <Wire.h>

void setup() {
  Serial.begin (9600);
  while (!Serial) 
    {
    }
  Serial.println ();
  Serial.println ("I2C scanner. Scanning ...");
  byte count = 0;
  
  Wire.begin();
  for (byte i = 8; i < 120; i++)
  {
    Wire.beginTransmission (i);
    if (Wire.endTransmission () == 0)
      {
      Serial.print ("Found address: ");
      Serial.print (i, DEC);
      Serial.print (" (0x");
      Serial.print (i, HEX);
      Serial.println (")");
      count++;
      delay (1);  // maybe unneeded?
      } // end of good response
  } // end of for loop
  Serial.println ("Done.");
  Serial.print ("Found ");
  Serial.print (count, DEC);
  Serial.println (" device(s).");
}  // end of setup

void loop() {}

Downloads

Connections Between Arduino and I2C Module

ConnectingTheLCDwithArduino.JPG
I2C_pins.jpg

GND(I2C) -->GND

VCC(I2C) -->5V

SDA(I2C) -->A4

SCL(I2C) -->A5

Note that SDA means serial data line and SCL stands for serial clock line.

Final_Coding

Press Ctrl + shift + I .

Find the: LiquidCrystal I2C (by Frank de Brabander) library and install it.

#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27,19,4);  // set the LCD address to 0x27

void setup()
{
  lcd.init();
  lcd.backlight();
  lcd.print("Hello World my name is Andronikos!");
}


void loop()
{
}<br>

Downloads

The Results!!!

Its_Done.jpg