April 2020
Intermediate to advanced
294 pages
7h 53m
English
The command parser that we created earlier has several commands that you will recognize:
We need to send these commands to the sensor node in a JSON formatted string. For example, we can send a message to turn on LED1 by sending the following code line:
{“LED1”: “On”}
We can also turn the same LED off by sending the following code line:
{“LED1”: “Off”}
We are not limited to controlling a single LED at once. For example, we can construct a JSON message that allows us to command all the LEDs at once. If I wanted to turn on LED1 and LED3 while turning LED2 off, I could construct a JSON message that looks like the following:
{“LED1”: “On”, “LED2”: “Off”, “LED3”: “On”}
The final test for our sensor node ...
Read now
Unlock full access