• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

include/11-Mar-2024-510134

CMakeLists.txtD11-Mar-2024211 116

README.mdD11-Mar-20241.3 KiB2219

component.mkD11-Mar-2024145 50

iot_led.cD11-Mar-202418.8 KiB553438

iot_light.cD11-Mar-202418.3 KiB519407

light_driver.cD11-Mar-202429.6 KiB900680

README.md

1# Component: Light
2
3* This component defines a light as a well encapsulated object.
4* A light device is defined by:
5    * ledc timer which is used to control the pwm channels of light
6    * mode of the ledc timer
7    * frequency of the ledc timer
8    * pwm channel number of the light
9    * bit number of the ledc timer
10* A light device can provide:
11    * iot_light_channel_regist function to add channel to corresponding channel id
12    * iot_light_duty_write function to set the duty of corresponding channel and it support setting duty directly or gradually
13    * iot_light_breath_write function to set the corresponding channel to breath mode and breath period can be set
14    * iot_light_blink_starte and iot_light_blink_stop function to make some of channels to blink in appointed period. Note that if any channel works in blink mode, all the other channels would be turned off.
15
16* To use the light device, you need to:
17    * create a light object returned by iot_light_create()
18    * regist the light channels according the channel number by iot_light_channel_regist()
19    * To free the object, you can call iot_light_delete to delete the button object and free the memory.
20
21### NOTE:
22> If any channel(s) work(s) in blink mode, all the other channels would be turned off. iot_light_blink_stop() must be called before setting any channel to other mode(write duty or breath).