Now that we know how output pins (both digital and PWM) work, we're going to take a look at specialized output devices. These devices use multiple pins for one device for a number of reasons: some use protocols that are widely known, some are proprietary, some just require a lot of pins to output a lot of data. We'll take a look at a few of the well-known protocols and build a project with one such device: a character LCD, reminiscent of a calculator. This chapter will cover the following topics:
For the project in this chapter, you'll need your board, a USB cable, and a character LCD character display. A breadboard and a handful of breadboard wires will also come in handy.
We will go over how to use character LCDs with or without an I2C interface. An example of one with an I2C interface can be found here: http://www.amazon.com/SainSmart-Serial-Module-Display-Arduino/dp/B00813HBEQ. A way to quickly identify an I2C-compatible character LCD is by the backpack that is presoldered on to it, as shown in the following examples. It only uses four pins labeled as VCC, GND, SDA, and SCL:
An example of a character LCD without an I2C interface is available here: https://www.adafruit.com/products/181. The main visible difference is that these character LCDs use more than the four pins used by I2C interfaces.
The following screenshot is an example of this:
Note that if you are using a board that is NOT an Arduino, read the section on checking compatibility BEFORE buying your character LCD—you'll want to make sure that your board is I2C-compatible beforehand. All Arduino boards used here had I2C compatibility with Johnny-Five at the time of writing this book.