PROJECTS Magic GIF-Ball Fortune Teller
(Figure
B
). If you print the logo in black, you
can coat it a solid white and then scrape away
(once dry) within the letters to reveal the black
underneath, or as I did in the original version, use
a fine tip brush to fill in the letters (Figure
C
). I’m
not a fan of hand painting, but perhaps you have
steadier hands than I!
3. SET UP THE RASPBERRY PI
There’s very little to do Linux-wise to prepare
your Pi (Figure
D
). First, flash the latest Pi OS
onto your microSD card (Raspbian Lite is OK as
the screen is run directly and doesn’t mirror the
X framebuffer). Raspberry Pi’s new imager tool
(raspberrypi.org/software) makes this all much
more streamlined if you haven’t heard the word.
Get ready for basic headless setup by entering
your Wi-Fi credentials. Once connected via SSH,
you’ll need to install the ST7789 Python module
from Pimoroni (github.com/pimoroni/st7789-
python) by entering the command:
sudo pip install st7789
They recommend installing some other common
modules first, but I found that these were already
up to date in the current OS. Also, be sure to run
sudo raspi-cong and enable I²C and SPI.
4. WIRE AND TEST THE DISPLAY
Before connecting any other components, let’s
test our little TFT LCD display to make sure we’ve
connected it properly and the software is good
to go. With the Pi unpowered, use the female
jumpers to make the following connections
between the LCD and the Pi (Figure
E
); they’ll
communicate using the SPI serial protocol:
3v3 to any 3V pin
TCS to Pi pin 7 — this is the SPI chip select pin
for the TFT display
SCK to pin 11 the SPI clock input pin
SI to pin 10 the SPI MOSI pin (microcontroller
out, serial in) to send data to the display
D/C to pin 9 the SPI data or command
selector pin
BL to pin 19
GND to any Pi ground pin
Double-check your wiring, boot up the Pi, and cd
into the folder st7789-python/examples. Then call:
python3 gif.py
B C
D E
64 makezine.com
M78_062-67_MagicGifBall_F1.indd 64M78_062-67_MagicGifBall_F1.indd 64 7/11/21 10:51 AM7/11/21 10:51 AM
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.244.201