T-Embed CC1101 Quick Start
Required Libraries
| Library | Version | Source |
|---|---|---|
| TFT_eSPI | Latest | GitHub |
| RadioLib | Latest | GitHub |
| FastLED | Latest | GitHub |
| LVGL | 8.x | GitHub |
Arduino
PlatformIO (Recommended)
- Install VS Code and the PlatformIO IDE extension
- Clone the repository:bash
git clone https://github.com/Xinyuan-LilyGO/T-Embed-CC1101.git - Open
platformio.iniand select the target example - Click ✓ to build, connect via USB-C, click → to upload
Arduino IDE
Board Settings
| Setting | Value |
|---|---|
| Board | ESP32S3 Dev Module |
| Upload Speed | 921600 |
| USB CDC On Boot | Enable |
| CPU Frequency | 240 MHz (WiFi) |
| Flash Mode | QIO 80 MHz |
| Flash Size | 16 MB (128Mb) |
| Partition Scheme | 16M Flash (3MB APP/9.9MB FATFS) |
| PSRAM | OPI PSRAM |
Upload
Connect via USB-C and click Upload.
If upload fails: hold BOOT, press and release RST, then release BOOT to enter download mode.
LVGL
T-Embed CC1101 uses a 1.9-inch ST7789V TFT (320×170). LVGL 8.x is pre-configured via TFT_eSPI in the official repository.
cpp
#include <lvgl.h>
#include <TFT_eSPI.h>
static lv_disp_draw_buf_t draw_buf;
static lv_color_t buf[320 * 10];
TFT_eSPI tft;
void my_disp_flush(lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p) {
uint32_t w = area->x2 - area->x1 + 1;
uint32_t h = area->y2 - area->y1 + 1;
tft.startWrite();
tft.setAddrWindow(area->x1, area->y1, w, h);
tft.pushColors((uint16_t *)&color_p->full, w * h, true);
tft.endWrite();
lv_disp_flush_ready(disp);
}
void setup() {
tft.begin();
tft.setRotation(1);
lv_init();
lv_disp_draw_buf_init(&draw_buf, buf, NULL, 320 * 10);
static lv_disp_drv_t disp_drv;
lv_disp_drv_init(&disp_drv);
disp_drv.hor_res = 320;
disp_drv.ver_res = 170;
disp_drv.flush_cb = my_disp_flush;
disp_drv.draw_buf = &draw_buf;
lv_disp_drv_register(&disp_drv);
lv_obj_t *label = lv_label_create(lv_scr_act());
lv_label_set_text(label, "T-Embed CC1101");
lv_obj_align(label, LV_ALIGN_CENTER, 0, 0);
}
void loop() {
lv_timer_handler();
delay(5);
}Peripheral Examples
Display (ST7789V)
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-Embed CC1101", 40, 75);
}
void loop() {}CC1101 Sub-GHz Radio
cpp
#include <RadioLib.h>
// CC1101: CS=5, GDO0=4, RST=-1, GDO2=36
CC1101 radio = new Module(5, 4, RADIOLIB_NC, 36);
void setup() {
Serial.begin(115200);
int state = radio.begin(433.0);
if (state != RADIOLIB_ERR_NONE) {
Serial.print("CC1101 init failed: "); Serial.println(state);
while (true);
}
Serial.println("CC1101 ready");
}
void loop() {
int state = radio.transmit("Hello CC1101");
if (state == RADIOLIB_ERR_NONE) Serial.println("Sent OK");
delay(2000);
}RGB LED Strip (WS2812)
cpp
#include <FastLED.h>
#define LED_PIN 38
#define NUM_LEDS 8
CRGB leds[NUM_LEDS];
void setup() {
FastLED.addLeds<WS2812B, LED_PIN, GRB>(leds, NUM_LEDS);
FastLED.setBrightness(50);
}
void loop() {
for (int i = 0; i < NUM_LEDS; i++) {
leds[i] = CRGB::Blue;
}
FastLED.show();
delay(500);
FastLED.clear();
FastLED.show();
delay(500);
}FAQ
Q: Upload keeps failing?
A: Hold BOOT, press and release RST, then release BOOT to enter download mode.
Q: What frequency does CC1101 operate on?
A: CC1101 supports 315/433/868/915 MHz sub-GHz bands. Configure the frequency in code to match your regional regulations.
