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 turns on, and it Same with darkness, if the amount of 50 is exceeded, we have indicated to turn on a white LED.

JSON code:

{	"do": [		{			"thresholds": {				"bright": 200,				"dark": 50			}		},		{			"on": {				"do": [					{						"light": {							"color": 0,							"duration": 1						}					}				],				"event": "bright"			}		},		{			"on": {				"do": [					{						"light": {							"color": 1,							"duration": 1						}					}				],				"event": "dark"			}		}	]}