In this chapter, we have looked at how an ultrasonic sensor works, and we wrote a program to measure the distance values. Next, we programmed the 16x2 LCD, and read the ultrasonic distance value using it. We also looked at the I2C LCD, which takes the 16 LCD pin as an input, and provides four pins as an output, thus simplifying the wiring connections. Finally, we fitted the ultrasonic sensor on our robot to create our obstacle-avoiding robot. This robot moved freely when there was no obstacle near it, and if it approached an obstacle, it would avoid it by taking a turn.
In the next chapter, we are going to create two different types of PC-controlled robot. In the first PC-controlled robot, we will use a library called ncurses and use the keyboard as an input. In the second PC-controlled robot, we will create UI buttons using QT, and then use them to move the robot.
...