The Adafruit 1.3" Color TFT Bonnet is an add-on board designed for the Raspberry Pi, featuring a vibrant 1.3-inch TFT display with a resolution of 240x240 pixels. This compact and versatile bonnet not only provides a colorful output interface for your projects but also includes a 5-way joystick and three tactile buttons for user input, making it an ideal choice for portable gaming, user interfaces, or any project requiring a compact display and simple controls.
Pin Number | Description | Notes |
---|---|---|
1 | 3V3 | Power supply (3.3V) |
2 | 5V | Power supply (5V) |
3 | GPIO2 | SDA for I2C communication |
4 | 5V | Power supply (5V) |
5 | GPIO3 | SCL for I2C communication |
6 | Ground | Ground connection |
... | ... | ... |
26 | GPIO7 | SPI CE1 for display |
... | ... | ... |
36 | GPIO16 | Button A |
37 | GPIO26 | Button B |
38 | GPIO20 | Button C |
... | ... | ... |
40 | GPIO21 | Joystick button |
Note: This table is not exhaustive. Refer to the full pinout diagram for complete details.
Before using the display, you need to install the necessary software. Adafruit provides a Python library that makes it easy to draw to the display and read inputs from the joystick and buttons.
sudo apt-get update
sudo apt-get upgrade
sudo pip3 install adafruit-circuitpython-rgb-display
sudo pip3 install adafruit-circuitpython-joystick
raspi-config
:sudo raspi-config
Navigate to Interfacing Options
> SPI
and I2C
and enable both.
After installing the necessary libraries and enabling the interfaces, you can run a test script to ensure the display and joystick are working correctly.
import board
import digitalio
import adafruit_rgb_display.st7789 as st7789
cs_pin = digitalio.DigitalInOut(board.CE0) dc_pin = digitalio.DigitalInOut(board.D25) reset_pin = None
display = st7789.ST7789( board.SPI(), cs=cs_pin, dc=dc_pin, rst=reset_pin, width=240, height=240, baudrate=64000000, rotation=180 )
display.fill(0x7521)
*Note: This is a basic example to get the display up and running. For full functionality, including joystick and button input, refer to the Adafruit documentation and example code.*
dmesg
and lsmod
commands to check for any kernel messages or modules related to SPI and I2C.Q: Can I use this bonnet with other models of Raspberry Pi? A: Yes, the bonnet is compatible with any Raspberry Pi model that has a 40-pin GPIO header.
Q: How do I update the display content? A: You can use the Adafruit Python library to draw text, shapes, and images to the display. Check the library documentation for detailed functions and examples.
Q: Can I use this bonnet with other programming languages? A: While Adafruit provides a Python library, you can use any language that can interface with the SPI and I2C protocols, provided you have the necessary libraries or write your own interface code.
For further assistance, visit the Adafruit forums or the Raspberry Pi community forums.