In this chapter, we turned T.A.R.A.S into a true IoT thing by publishing the distance data—the distance from the eyes of T.A.R.A.S to any object within its view—to the internet. By encapsulating our code into a class called RobotEyes, we can forget that we are dealing with a distance sensor and just focus on the eyes of T.A.R.A.S as behaving sonar-like.
Through the use of the demo platform in ThingsBoard, we are able to write code that sends the distance information from T.A.R.A.S to a dashboard widget for display. If we really wanted to be creative, we could connect an actual analogue device via a servo and display the distance information that way (as we did in Chapter 6, Working with the Servo Control Code to Control an Analog Device). In Chapter 16, Controlling the Robot Car with Web Service Calls, we will take things a step further and start to control...