In this programming example, I will show how to interface a 16x2 character LCD with the Arduino Uno board. Arduino is very popular for electronic hobbyist, engineering projects, and DIY electronics, etc. A character LCD is very popular, low cost, and it's very easy to program. However this type of LCD use a parallel port interface that requires many wires. It's 8-bit wide, but the programmer can use only 4-bit mode to cut down the total in-circuit wires.
A running program on my prototyping board |
In this example, I also use serial port to send character data to the Arduino Uno Board. Finally those data will send to the character LCD.
Schematic Diagram |
We can also use tinkercad to draw and simulate this example using web browser.
Circuit View |
Arduino Source Code:
#include <LiquidCrystal.h> LiquidCrystal lcd(7,8,9,10,11,12); void setup(){ Serial.begin(9600); lcd.begin(16,2); lcd.print("Arduino Uno LCD"); lcd.setCursor(0,1); lcd.print("Example"); delay(3000); lcd.clear(); lcd.blink(); } void loop(){ if(Serial.available()>0){ char temp = Serial.read(); lcd.print(temp); } }
Click here to download this example.
No comments:
Post a Comment