DfRobot provides the simplest way to get started with LiquidCrystalIO on Uno and Mega (and other compatible boards). It has a display with an array of switches connected to A0 (up, down, left, right and select). This library works correctly with the display and even has a shorthand way of creating the LCD for this case.
This board is for use with Arduino Uno and Mega devices, because they are compatible with the original wiring pin out spec. The pin connections are as follows:
Pin | Function |
---|---|
8 | RS |
9 | EN |
10 | Backlight |
A0 | Buttons |
4 | D4 |
5 | D5 |
6 | D6 |
7 | D7 |
A0 | Joystick |
When using with LiquidCrystalIO, you can use the no-argument constructor, which is specifically for DfRobot where the pins are known upfront.
As the backlight is actually on a PWM pin (at least on Uno), then you have the option of configuring the library to use PWM for the backlight instead.
During setup simply do the following:
// DF robot back light is on pin 10, which is PWM, provide values between 0 and 255
myLcd.configureAnalogBacklight(internalAnalogIo(), 10);
myLcd.setBacklight(128);
This allows you to control the backlight level at any time by using the setBacklight
method.