Summary
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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access