Skip to main content

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โ€‹

CategoryWhat it coversTutorials
peripherals/GPIO, I2C, SPI, UART, PWM, ADC, display, audio, button, camera, IMU, LED, IR, touchGPIO Tutorial, I2C Guide, ADC Guide, Sensor Driver
wifi/Station connect, AP mode, scanning, low powerWi-Fi Tutorial
system/Threads, timers, mutex, semaphore, queue, events, KV storageThread & Timer Patterns
ble/BLE central (scan + connect) and peripheral (advertise + GATT)BLE Central, BLE Peripheral
protocols/HTTP/HTTPS client, MQTT client, TCP client/serverHTTP and HTTPS (GET/POST, JSON), MQTT Client, TCP and UDP sockets
graphics/LVGL demos, u8g2 I2C/SPI displaysLVGL Application Guide, Display Driver Guide
multimedia/Keyword spotting (KWS), audio player, recorder, VADAudio 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

Referencesโ€‹