Generic Demos
The TuyaOpen provides a variety of sample projects to facilitate developers in quickly getting started and understanding the usage of the TuyaOpen.
$ examples
âââ ble
â âââ ble_central
â âââ ble_peripher
âââ get-started
â âââ sample_project
âââ peripherals
â âââ adc
â âââ gpio
â âââ i2c
â âââ pwm
â âââ spi
â âââ timer
â âââ watchdog
âââ protocols
â âââ http_client
â âââ https_client
â âââ mqtt
â âââ tcp_client
â âââ tcp_server
âââ system
â âââ os_event
â âââ os_kv
â âââ os_mutex
â âââ os_queue
â âââ os_semaphore
â âââ os_sw_timer
â âââ os_thread
âââ wifi
âââ ap
âââ low_power
âââ scan
âââ sta
Select the project to be compiled
Each chip model comes with corresponding example projects.
To select the example to be compiled, enter the example directory using the command cd ./example/xxx/xxx
, then set the compilation platform with the command tos.py config choice
.
Each sample project includes a README.md file that provides detailed instructions on configuring, compiling, and running the project.
Compile the example
- Run the
tos.py config choice
command to select the current development board or platform. - If you need to modify the configuration, run the
tos.py config menu
command to make changes. - Run the
tos.py build
command to compile the project.