When we execute this code, what we get is that when we press the circle a red LED lights up, and then with the go function, which is to be able to use the remote control for 5 seconds and once we have been with the control for five seconds it goes to run a green LED. And then if we press number one, a blue LED will light up and nothing else will be done.
JSON code:
{ "do": [ { "on": { "do": [ { "infrared": { "command": "record", "key": 0, "recordTime": 5, "success": [ { "light": { "color": 5, "duration": 1, "led": 0 } } ] } }, { "light": { "color": 12, "duration": 5, "led": 0 } } ], "event": "touchCircle" } }, { "on": { "do": [ { "infrared": { "command": "send", "key": 0 } }, { "light": { "color": 8, "duration": 1, "led": 0 } } ], "event": "touch1" } } ]}Lesson 10: Thresholds
In this exercise, we have programmed the brightness and darkness with exact amounts, thank you. Thanks to the thresholds function, specifically we have set a brightness of 200 and we have programmed the darkness with an exact amount of 50. Subsequently we have included that if the indicated brightness amount is exceeded, a black LED