siliconchip.com.au Australia’s electronics magazine May 2019 95
Parts list –
Arduino breakout board
1 double-sided PCB coded 24111181, 98x55mm
1 3.5in 480x320 pixel ILI9488-based LCD touchscreen with
SPI interface
1 Arduino R3-compatible board, such as the Uno R3, Mega
R3 or Leonardo R3
1 10-way pin header
2 8-way pin headers
1 6-way pin header
1 4-way pin header
1 14-way female header (CON1)
1 4-way female header (CON2)
2 3-way female header strip OR
3 2-way female header strips
4 12mm-long M3 tapped spacers
8 6mm M3 panhead machine screws
1 2-way male header strip and jumper shunt (JP1; optional)
Resistors (all 1/4W 1% or 5%)
7 1k (brown black red gold or brown black black brown brown)
7 470 (yellow violet brown gold or yellow violet black black brown)
and female headers as the 12mm spacers are longer than
the approximately 11mm combined height of the headers,
but they should still make good contact so this shouldn’t
cause any problems.
Software
The sketches we have created are designed to stand on
their own and do not require any separate libraries to be
installed. The ZIP download package contains three sam-
ple sketches, all starting with “SPI”.
Extract the contents of the .zip file to somewhere on
your computer, and open one of the files with the Arduino
IDE. Select the appropriate board and port combination,
and click “Upload”. The three examples work as follows:
- “SPI_320x480_display_demo” draws boxes, lines and
text to the display as it cycles through the four possible
orientation settings (two in portrait and two in land-
scape). - “SPI_3.5_inch_TFT_shield_demo_wth_touch” shows off
the touch feature by drawing lines and displaying the
current touch coordinates to the display. - “SPI_3.5_inch_TFT_touch_calibration” can be used to
fine-tune the touch settings, although we found the de-
fault calibration worked fine with three different screens.
The touch calibration sketch requires the Arduino Se-
rial Monitor to be running. During the calibration stage, it
will send four lines of text to the Monitor that should be
copied over the similar lines in any sketch that uses these
touch routines.
For example:
#define TOUCH_X0 1
#define TOUCH_X1 2001
#define TOUCH_Y0 199
#define TOUCH_Y1 76
You might also like to experiment with the library we
mentioned earlier, remembering to change the pin defini-
tions near the start of the “graphicstest” sketch like this:
#define TFT_CS 10
#define TFT_DC 9
#define TFT_LED -1
#define TFT_RST 8
The library can also be installed via the Library Man-
ager by searching for “ili9488” (see Fig.4). It also requires
The completed R3
to LCD Adaptor. Note the
jumper (highlighted above) is not
populated and we have fitted headers for both 3.5 and 2.8
inch displays, although you will probably only use one
(fit one or the other). If using the 2.8 inch display, you can
break this PCB along the slots at the right side.
the “Adafruit_GFX” library to be installed, which can be
found by searching for its name in the Library Manager.
In the software resource bundle for this project, we’ve
included .zip files of the current versions of these open-
source libraries in case you have trouble finding them.
Future updates
Now that we have confirmed that these displays can be
used on both the Arduino and Micromite platforms, we
plan to use them in future projects.
Before we use them with a Micromite, we will need to
write CFUNCTIONs to get an acceptable display update
speed.
ORDER NOW AT
http://www.siliconchip.com.au/shop
INTO MODEL RAILWAYS
IN A BIG WAY?
With lots of points, multiple tracks, reversing loops, multiple
locos/trains,– in other words, your model trains are more a
passion than just a hobby? Then you might be interested in
these specialised model train projects fromMarch 2013
Automatic Points Controller
(Supplied with two infrared sensor boards)
(PCB 09103131/2)........................$13.50
Frog Relay Board (09103133)............$4.50
Capacitor Discharge for Twin-Coil Points
Motors (PCB 09203131)..................$9.00
See article previews atwww.siliconchip.com.au
SC