Pin 6, the Clock (Enable) line, tells the display when you are actually ready to perform the instructions. The downside is that I will not be able to read from the LCD this way, but hey you can’t have it all! To save a pin on my Arduino, I connected the R/W pin to ground (essentially keeping it in write mode all the time). The R/W line (pin 5) indicates whether you intend to read from registers (high) or write to the registers (low). When you write with the RS pin set to high, you are accessing the Data Register and writing characters/data to be displayed on screen. When you perform a read or write with RS (pin 4) set to low, you are accessing the Command Register and giving the LCD module commands like “Clear Display”, “Set Cursor Position” etc. These lines indicate what kind of instructions are going to be sent over the data lines (pins 7-14).Ĭharacter LCD modules are accessed through two “registers”, the Command Register, and the Data Register. Pins 4, 5 and 6 are the control lines for the LCD. To my surprise, greater contrast comes with lower voltage and you should never apply a voltage higher than VCC. Most character LCDs can achieve good display contrast with a voltage between 5V and 0V on pin 3. I connected a 10K Ohm trimpot, to be able to adjust the contrast manually. By changing the voltage or duty cycle of pin 3, the contrast of the display can be adjusted. Pin 2 is VCC and should be connected to +5V power. Pin 1 is GND and should be grounded to the power supply. The first three pins provide power to the LCD module.
Arduino lcd library commands clear drivers#
After some poking around on the Internets, I confirmed that the drivers at the back of my “new” LCD were indeed compatible with the Hitachi one. The standard 14 pin female header on my LCD was a good sign. The LiquidCryslal Arduino library seemed like the place to start, but its description specifically mentioned that it works with LCDs based on the Hitachi HD44780 driver.
Arduino lcd library commands clear how to#
The next thing to find out was how to hook this up to my Arduino Uno. On the back of the LCD I could see five KS00065B LCD Driver chips. The pins were helpfully labeled on the front of the panel (from 1 to 14). There was a ribbon cable attached to the LCD with a 14 pin female connector. Among some of the more promising salvaged components was a 40 x 2 character LCD. A couple of days ago I came across a discarded Meridian PBX phone and naturally, took it apart.