Page 78 - Programming the Photon Getting Started With the Internet of Things
P. 78
Load this program into your Photon and see what happens. The LED will flash on for one
second and wait another second before switching off. This is a simple program that shows
the basics for outputs using the Photon board.
LCD Display
One of the best things about using an embedded device such as the Photon board is that it
can operate independently from any computer. But if you want to display information, it
can be rather tricky using embedded boards, and sometimes a simple traffic light LED
system just does not display information. A commonly found component on finished
goods is a liquid crystal display (LCD). This can be used to display more complex
information such as sensor values, timing information, settings or progress bars, etc. In
this experiment you will learn how to connect a standard LCD display to the Photon board
and how to program it to display any information that is relevant to your projects. We will
also look at already existing libraries that can be found using the build environment, and
we can import those into our projects, which can save some time when writing our
program.
To complete the example in this chapter we are going to use a parallel LCD screen.
These are common LCD displays and often can be salvaged from old electronic finished
goods that have been lying around collecting dust in your basement for years such as old
VCRs or DVD players. They come in all different kinds of shapes and sizes, with the most
common being a 16 × 2 character display with a single row of 14 pin headers or 16 if it
has a backlight. This configuration gives us a maximum of 32 characters we can display at
any given time, with 16 characters on two rows.
If your LCD display did not come with any pin headers already soldered on, you will
need to solder one on so you can insert it into the breadboard and then use jumper wires to
connect the Photon board. With the headers successfully soldered on to the LCD display, it
should something like Figure 4.5.