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 different chip has corresponding examples, and you can set the example project through the tos set_example
command.
To select the example to be compiled, use the tos set_example
command to choose based on the platform. The examples
directory will be modified to match the selected platform's example.
$ tos set_example
Now used: None
========================
Platforms
1. T2
2. T3
3. Ubuntu
4. T5AI
5. ESP32
6. LN882H
7. BK7231X
------------------------
Please select: 4
------------------------
Set [T5AI] example success.
Note: After setting with the tos set_example
command, the examples
directory is a symbolic link pointing to the chip in the corresponding directory under the platform.
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 config_choice
command to select the current development board in use. - If you need to modify the configuration, run the
tos menuconfig
command to make changes. - Run the
tos build
command to compile the project.