EBC Exercise 12a 2.4 TFT LCD display via SPI



This is an exercise in interfacing the 2.4" TFT LCD display (ili9341) via a SPI bus.

The Hardware
This table shows how to wire the LCD display for SPI 0.

The Software
Clone the course repo.

bone$ git clone https://github.com/MarkAYoder/BeagleBoard-exercises.git exercises

and then

bone$ cd exercises/display/ili9341/fb bone$ git pull bone$ ./on.sh

After a moment the display should turn dark. Look in on.sh to see what it did.

Displaying Images
Follow the instructions in install.sh to download fbi and some images. bone$ sudo apt update bone$ sudo apt install fbi Display them with: bone$ fbi -noverbose -T 1 -a boris.png You should now see Boris the Beagle on your display.

Playing Movies
Install mplayer and load a movie on the Bone (see install.sh). bone$ sudo apt install mplayer

Play the movie. Rotate the movie.

Generate Text
Install imagemagick. bone$ sudo apt install imagemagick

See text.sh for an example of using imagemagick to write text to the LCD display. Write your name on the LCD. Display an image and write some text on it.

SIZE=320x240 TMP_FILE=/tmp/frame.png convert -background lightblue -fill blue -font Times-Roman -pointsize 24 \ -size $SIZE \ label:'ImageMagick\nExamples\nby Anthony' \ -draw "text 0,200 'Bottom of Display'" \ $TMP_FILE sudo fbi -noverbose -T 1 $TMP_FILE
 * 1) Here's how to use imagemagick to display text
 * 2) Make a blank image
 * 1) From: http://www.imagemagick.org/Usage/text/