Interface LCD with ARDUINO

0
3496
lcd arduino

ARDUINO LCD

[nextpage title=”Description” ]

There are varieties of electronic display system display systems in this world from simple LED display to high end laser display systems.

Most of them are a using some predefined pattern of display which is then repeated again and again.

There is also another kind of display systems which use a random pattern of display and hence differ from other kind in terms of working and attractiveness.

This particular project explains how to display smileys in a 16×2 LCD in a random manner with the help of an Arduino board.

The Arduino is referred to as an easy prototyping platform which has been popular among both hobbyist and experts and widely used in industries as well.

Any AVR microcontroller based board which follows the standard Arduino schematic and is flashed with the Arduino bootloader can be called an Arduino board.

All the Arduino boards are compatible with the Arduino IDE which helps to compile the code and program the Arduino boards.

The Arduino IDE is very simple to use and anyone having the basic knowledge of C programming can easily start with it.

The Arduino IDE provides lot of built-in functions and among them there are functions for accessing LCD modules and generating random numbers also.
[/nextpage] [nextpage title=”Video” ]

[youtube height=”HEIGHT” width=”WIDTH”]https://www.youtube.com/watch?v=dKlynvrbQ2o&feature=youtu.be[/youtube]

[/nextpage]

[nextpage title=”Circuit Diagram” ]

arduino lcd

[/nextpage]

[nextpage title=”Code” ]

[visitor]

⇒ Subscribe to view Code (Free Registration )

[/visitor]

[member]

[message_box title=”code” color=”yellow”]

/*============================ EG EC LABS / ARDUINO PROJECTS ===================================//

Demonstration on how to make a random smiley display in an LCD using Arduino

//============================ EG EC LABS / ARDUINO ===================================*/
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

//—————– store the custom characters in arrays ———————//
byte heart[8] =
{
0b00000,
0b01010,
0b11111,
0b11111,
0b11111,
0b01110,
0b00100,
0b00000
};

byte smile[8] =
{
0b00000,
0b00000,
0b01010,
0b00000,
0b10001,
0b01110,
0b00000,
0b00000
};

//—————– store the custom characters in arrays ———————//

long randNumber; // the variable which is supposed to hold the random value
const int ledPin = 6; // the number of the pin at which the LED is connected

void setup()
{
pinMode(ledPin, OUTPUT);

//—- create custom characters —-//
lcd.createChar(1, heart);
lcd.createChar(2, smile);
//—- create custom characters —-//

// set up the lcd’s number of columns and rows:
lcd.begin(16, 2);
lcd.print(“Engineer Gallery”);
lcd.setCursor(0, 1);
lcd.print(” Smily Arduino “);
delay(3000);

Serial.begin(9600); // initialize the serial port
randomSeed(analogRead(0)); // initialize the pseudo-random number generator
}

void loop()
{
digitalWrite(ledPin, HIGH); // LED ON

randNumber = random(0, 16); // generate a random number
lcd.setCursor(randNumber, 0); // set the cursor at the cursor position given by the random number at first line
lcd.write(1); // display snmiley 1
lcd.setCursor(randNumber, 1); // set the cursor at the cursor position given by the random number at second line
lcd.write(2); // display snmiley 1

randNumber = random(0, 16); // generate a random number
lcd.setCursor(randNumber, 0); // set the cursor at the cursor position given by the random number at first line
lcd.write(2); // display snmiley 2
lcd.setCursor(randNumber, 1); // set the cursor at the cursor position given by the random number at second line
lcd.write(1); // display snmiley 1

delay(250); // wait for a while
digitalWrite(ledPin, LOW); // LED OFF
delay(250); // wait for a while

lcd.clear(); // clear the LCD
}

[/message_box]

[/member]

[/nextpage]

You can also understand basics terms like arduino lcd, arduino lcd shield, arduino serial lcd, arduino graphic lcd, arduino lcd clock, arduino lcd color, graphic lcd arduino, graphical lcd arduino.