Building Arduino Projects for the Internet of Things

(Steven Felgate) #1
CHAPTER 4 ■ COMPLEX FLOWS: NODE-RED

Figure 4-27. Log messages from the light sensor tweet system

Figure 4-28. Tweet from the light sensor tweet system


Arduino will be continuously sending data to the server, so as soon as you put the
sensor in bright light, the Node-RED flow condition will become true and a tweet will
be sent. This is shown in Figure  4-28. There is no condition to send this once, so the
application will keep sending tweets unless the sensor is moved away from bright light or
turned off.

Summary


In this chapter you learned about Node-RED and developed a simple flow that is initiated
by Arduino. This flow publishes a tweet whenever a certain threshold value is crossed.
You can utilize hundreds of readily available nodes in Node-RED to expedite your
IoT application development.
Free download pdf