How to Set Up and Program an LCD Display on an Arduino
Scott Campbell from circuitbasics.com has a nice tutorial on how to use a common Hitachi HD44780 LCD display on Arduino. Many of the functions available are discussed and shown in examples. He writes:
In this tutorial, I will explain how to set up an LCD display on an Arduino, and show you (with examples) all of the functions available to program it. The display I will be using here is a 16×2 LCD display that I bought for under $10 on Amazon. They can be very useful in projects that output data, and will make your project look a lot more interesting. You may be wondering why these displays are called 16×2 LCDs. The 16×2 means that LCD has 2 lines and can display 16 characters per line, and LCD stands for “liquid crystal display”. Therefore, a 16×2 LCD screen can display up to 32 characters at once. It is possible to display more than 32 characters by using commands that scroll text left or right. You can also create your own special characters and animations.The code in this article is written for LCD’s that use the standard Hitachi HD44780 driver. If your LCD has 16 pins, then it probably has the Hitachi HD44780 driver. These displays are capable of 4 bit mode or 8 bit mode output. 4 bit mode has a refresh rate of 74 milliseconds, while 8 bit mode has a faster refresh rate of 5 milliseconds. In this tutorial, we will be using the screen in 4 bit mode.…Wire the LCD to the Arduino Board
You may need to solder a 16 pin header to the LCD before using it with a bread board. Follow the diagram below to wire the LCD to your Arduino:The resistor is 220 Ohms here but other values will work too. Larger values of this resistor will dim the screen backlight. The potentiometer is 10K Ohm and is used to adjust the screen contrast. Pins 7 to 10 are only used if the LCD is to be operated in 8 bit mode.
0 التعليقات:
إرسال تعليق