In this demo, we will show you how to use the MCU SDK to develop a spoon that can enhance salty flavor and connect this spoon to the Tuya IoT Cloud with the Tuya Smart app.
Features:
-
Battery level detection
-
Frequency control
-
Download Tuya IoTOS Embedded Code.
-
Run
test.uvprojx
. -
Click Compile on the software to download the code.
├── SYSTEM
│ ├── main.c
│ └── main.h
└── SDK
├── mcu_api.c
├── mcu_api.h
├── protocol.c
├── protocol.h
├── system.c
├── system.h
└── bluetooth.h
Entry file: main.c
Main function: main()
- Initialize and configure I/Os, USART, and timer of the MCU. All events are polled and determined in
while(1)
.
-
Process DP data:
mcu_dp_value_update()
Function unsigned char mcu_dp_value_update(unsigned char dpid,unsigned long value) dpid DP ID value DP data Return SUCCESS
: DP data reporting succeeded.ERROR
: DP data reporting failed.
ADC | UASRT1 | Frequency |
---|---|---|
P5.5 | P3.3 TXD | P5.4 |
P3.2 RXD |
You can get support from Tuya with the following methods: