Example Project Description

Last Updated on : 2024-06-24 10:18:13download

TuyaOS Networked Product Development Framework includes several example projects that can help you quickly get familiar with the framework’s capabilities to create smart products with peripherals.

For more information, see Capability Map.

Example project

tuyaos_demo_quickstart

The minimum system instance required to connect to the Tuya Developer Platform.

Features include:

  • Initialize the TuyaOS SDK.
  • TuyaOS production testing service starts mf_test, enabling you to write Tuya-enabled licenses and test the GPIO.
  • Press and hold a specific button on an unpaired device to put it into pairing mode. Press and hold a specific button on a paired device to reset it and enter pairing mode.
  • The LED indicator signals the status of the Wi-Fi module.
  • Receive, process, and respond to the control commands.
  • Press a specific button to proactively report the device status.

tuyaos_demo_examples

Demonstrate and run various TuyaOS capabilities using the command line.

Features include:

  • Examples of hardware peripherals, including GPIO, ADC, I2C, PWM, SPI, and timer.
  • Examples of TuyaOS system APIs, including thread, mutex, semaphore, queue, and software timer.
  • The software watchdog os_watchdog.
  • os_wifi provides examples of Wi-Fi applications, including scanning, low power, connecting to a specified router in station mode, and access point (AP) mode.
  • os_ble provides examples of Bluetooth Low Energy (LE) applications, including the central and peripheral modes.
  • Examples of TuyaOS storage applications, including key-value database and UFile.
  • os_event provides examples of TuyaOS event applications.
  • service_soc_device provides TuyaOS capability applications, including device pairing and removal, as well as receiving and handling DPs of five different data types.
  • service_mf_test provides examples of the TuyaOS production testing service.
  • service_product_test provides examples of TuyaOS end product testing.
  • service_health_manager provides examples of health monitoring.
  • service_query_lowpower_dp provides examples of retrieving DP cache for low power devices.
  • service_ble_remote provides examples of Bluetooth LE remote applications.
  • service_ffc_master and service_ffc_slaver provide examples of Wi-Fi remotes sending and receiving data, respectively.
  • system_network provides examples of Transmission Control Protocol (TCP) applications.
  • service_http provides examples of HTTP applications.
  • service_http_download provides examples of file download over HTTP.

tuyaos_demo_application_driver

The driver code and examples of commonly used components.

  • Buttons, with features including:
    • Button press mechanism supports press, press and hold, and successive press.
    • Two types of button press detection: polling and interrupt.
  • LED indicators, with features including:
    • Three light behaviors: on, off, and blinking.
  • Dream color lighting effect, with features including:
    • Manage the compatible light drivers, such as WS2812, WS2814, SM16703P, SM16704PK, SM16714P, and YX1903B.
    • Multiple modes for color adjustment, including single point, all points, pixel panning, and pixel flipping.
  • Full color lighting effect, with features including:
    • Manage dimmer drivers, such as PWM, BP5758D, BP1658CJ, KP1805 series, and SM2135 series.
    • Unified dimming and color adjustment APIs.
  • Infrared, with features including:
    • Receive and transmit infrared signals.
    • Decode IR transmission protocols such as NEC.
  • Sensors, with features including:
    • Support temperature and humidity sensors such as SHT30, SHT40, and CHT8305.
    • Support IMU sensors.
  • Sound, with features including:
    • Use ADC to capture sounds from microphones.
  • Energy metering, including:
    • Manage energy metering drivers, such as HLW8012, HLW8032, BL0937, and BL0942.
    • Energy metering and chip calibration.