Generic Demos
TuyaOpen provides a variety of example projects to help you quickly familiarize yourself with and master the usage of TuyaOpen, significantly reducing the learning curve.
$ examples
โโโ ble
โ โโโ ble_central
โ โโโ ble_peripher
โโโ e-Paper
โ โโโ 1.54inch_e-Paper
โ โโโ 2.13inch_e-Paper
โ โโโ 2.9inch_e-Paper
โโโ get-started
โ โโโ cxx
โ โโโ sample_project
โโโ graphics
โ โโโ lvgl_camera
โ โโโ lvgl_demo
โ โโโ lvgl_gif
โ โโโ lvgl_label
โ โโโ u8g2_i2c
โ โโโ u8g2_spi
โ โโโ u8g2_tdl_disp
โโโ multimedia
โ โโโ audio_kws
โ โโโ audio_player
โ โโโ audio_recorder
โ โโโ audio_vad
โโโ peripherals
โ โโโ adc
โ โโโ audio_codecs
โ โโโ button
โ โโโ camera
โ โโโ display
โ โโโ encoder
โ โโโ flash
โ โโโ gpio
โ โโโ i2c
โ โโโ imu
โ โโโ ir
โ โโโ joystick
โ โโโ led
โ โโโ leds-pixel
โ โโโ pwm
โ โโโ sd
โ โโโ spi
โ โโโ timer
โ โโโ touch
โ โโโ tp
โ โโโ uart
โ โโโ watchdog
โโโ protocols
โ โโโ http_client
โ โโโ https_client
โ โโโ mqtt_client
โ โโโ tcp_client
โ โโโ tcp_server
โโโ system
โ โโโ os_event
โ โโโ os_kv
โ โโโ os_mutex
โ โโโ os_queue
โ โโโ os_semaphore
โ โโโ os_sw_timer
โ โโโ os_thread
โโโ tflite
โ โโโ tflite-helloworld
โโโ wifi
โโโ ap
โโโ low_power
โโโ scan
โโโ sta
Example Categoriesโ
| Category | What it covers | Tutorials |
|---|---|---|
| peripherals/ | GPIO, I2C, SPI, UART, PWM, ADC, display, audio, button, camera, IMU, LED, IR, touch | GPIO Tutorial, I2C Guide, ADC Guide, Sensor Driver |
| wifi/ | Station connect, AP mode, scanning, low power | Wi-Fi Tutorial |
| system/ | Threads, timers, mutex, semaphore, queue, events, KV storage | Thread & Timer Patterns |
| ble/ | BLE central (scan + connect) and peripheral (advertise + GATT) | BLE Central, BLE Peripheral |
| protocols/ | HTTP/HTTPS client, MQTT client, TCP client/server | HTTP and HTTPS (GET/POST, JSON), MQTT Client, TCP and UDP sockets |
| graphics/ | LVGL demos, u8g2 I2C/SPI displays | LVGL Application Guide, Display Driver Guide |
| multimedia/ | Keyword spotting (KWS), audio player, recorder, VAD | Audio Codec Guide |
| e-Paper/ | E-paper display demos (1.54", 2.13", 2.9") | |
| tflite/ | TensorFlow Lite Micro hello-world inference | |
| get-started/ | Minimal project template and C++ example |
Select a project to buildโ
Navigate to the desired example:
cd examples/peripherals/gpio
Select the board configuration:
tos.py config choice
note
Most examples default to T5AI. For ESP32, you may need to select an ESP32 config from the list, or create one in the example's config/ directory. See the ESP32 Quick Start for details.
Build the exampleโ
tos.py build
tos.py flash
tos.py monitor