Lesson 9: Remote control

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"			}		}	]}