T-Deck Plus Quick Start
Required Libraries
| Library | Version | Source |
|---|---|---|
| RadioLib | Latest | GitHub |
| TFT_eSPI | Latest | GitHub |
| TinyGPSPlus | Latest | GitHub |
| SensorLib | Latest | GitHub |
| LVGL | 8.4.0 | GitHub |
Do not upgrade libraries beyond the versions included in
T-Deck/lib/.
Arduino
PlatformIO (Recommended)
- Install VS Code and the PlatformIO IDE extension
- Clone the repository:bash
git clone https://github.com/Xinyuan-LilyGO/T-Deck.git - Open
platformio.iniand uncomment the example line you want to use (only one active at a time) - Click ✓ to build, connect via USB, click → to upload
Arduino IDE
1. Install ESP32 Board Support
- Open Arduino IDE → File → Preferences
- Add to "Additional Board Manager URLs":
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json - Go to Tools → Board → Boards Manager, search
esp32, install esp32 by Espressif Systems
2. Install Libraries
Copy all folders from T-Deck/lib/ to your Arduino libraries directory.
3. Board Settings
| Setting | Value |
|---|---|
| Board | ESP32S3 Dev Module |
| Upload Speed | 921600 |
| USB Mode | Hardware CDC and JTAG |
| USB CDC On Boot | Enabled |
| CPU Frequency | 240 MHz |
| Flash Mode | QIO 80 MHz |
| Flash Size | 16 MB (128Mb) |
| Partition Scheme | 16M Flash (3MB APP/9.9MB FATFS) |
| PSRAM | OPI PSRAM |
4. Upload
Click Upload.
If upload fails: hold the trackball center button (BOOT), insert USB, then click Upload. Press RST to exit download mode.
Examples
| Example | Description |
|---|---|
Keyboard_T_Deck_Master | Read keyboard input from T-Deck |
Microphone | ES7210 microphone noise detection |
Touchpad | Trackball position reading |
GPSShield | GPS module (MIA-M10Q) example |
UnitTest | Full factory hardware test |
LVGL
T-Deck Plus uses an ST7789 TFT (320×240). LVGL 8.4.0 is included in the T-Deck/lib/ folder.
cpp
#include <LilyGo_TDeck.h>
void setup() {
board.begin();
board.display.fillScreen(TFT_BLACK);
lv_init();
// LVGL draw buffer and display driver are set up by the board library
board.display.lvgl_begin();
lv_obj_t *label = lv_label_create(lv_scr_act());
lv_label_set_text(label, "T-Deck Plus");
lv_obj_align(label, LV_ALIGN_CENTER, 0, 0);
}
void loop() {
lv_timer_handler();
delay(5);
}Peripheral Examples
Display (ST7789)
cpp
#include <TFT_eSPI.h>
TFT_eSPI tft;
void setup() {
tft.begin();
tft.setRotation(1);
tft.fillScreen(TFT_BLACK);
tft.setTextColor(TFT_WHITE, TFT_BLACK);
tft.setTextSize(2);
tft.drawString("T-Deck Plus", 80, 110);
}
void loop() {}LoRa (SX1262)
cpp
#include <RadioLib.h>
// T-Deck SX1262: CS=9, IRQ=40, RST=17, BUSY=13
SX1262 radio = new Module(9, 40, 17, 13);
void setup() {
Serial.begin(115200);
// Power on LoRa module
pinMode(10, OUTPUT);
digitalWrite(10, HIGH);
delay(100);
int state = radio.begin(915.0);
if (state != RADIOLIB_ERR_NONE) {
Serial.print("Radio init failed: "); Serial.println(state);
while (true);
}
Serial.println("SX1262 ready");
}
void loop() {
int state = radio.transmit("Hello T-Deck Plus");
if (state == RADIOLIB_ERR_NONE) Serial.println("Sent OK");
delay(2000);
}GPS (MIA-M10Q)
cpp
#include <TinyGPSPlus.h>
TinyGPSPlus gps;
// GPS on Serial1: RX=21, TX=48, 38400 baud
HardwareSerial gpsSerial(1);
void setup() {
Serial.begin(115200);
gpsSerial.begin(38400, SERIAL_8N1, 21, 48);
}
void loop() {
while (gpsSerial.available()) gps.encode(gpsSerial.read());
if (gps.location.isUpdated()) {
Serial.printf("Lat: %.6f Lng: %.6f\n",
gps.location.lat(), gps.location.lng());
}
}Important Notes
- The Grove interface pins on T-Deck Plus are allocated to the GPS module — they cannot be used as a general-purpose connector.
- When powered by battery, GPIO10 must be set HIGH.
- The LoRa SX1262 shares the SPI bus — keep all other SPI device CS lines HIGH before communicating with it.
FAQ
Q: Upload keeps failing?
A: Hold the trackball center button (BOOT), insert USB, then click Upload.
Q: Does T-Deck Plus have a touchscreen?
A: No. It uses a trackball navigation module for input.
Q: Screen display looks wrong?
A: T-Deck updated the ST7789 initialization sequence on 2024-07-26. Make sure your library matches the current repo version.
