Skip to Content
Hands-On Robotics Programming with C++
book

Hands-On Robotics Programming with C++

by Dinesh Tavasalkar
March 2019
Intermediate to advanced
312 pages
7h 37m
English
Packt Publishing
Content preview from Hands-On Robotics Programming with C++

The I2C LCD and the ultrasonic sensor program

To read the ultrasonic sensor value inside an I2C LCD, connect the ultrasonic sensor and I2C LCD to the RPi. From the GitHub repository of Chapter04, you can download the complete program called I2CLCDdm.cpp program. The wiring connections of I2C LCD, ultrasonic sensor, and the RPi is shown in the following figure:

This I2CLCDdm.cpp program is basically a combination of the DistanceMeasurement.cpp and the I2CLCD.cpp programs. In this program, after declaring all the necessary libraries and variables related to the ultrasonic sensor and the I2C LCD below the cout << "Distance: "<<distance << "cm" ...

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.
Start your free trial

You might also like

Learn Robotics Programming

Learn Robotics Programming

Danny Staple
C++ Reactive Programming

C++ Reactive Programming

Praseed Pai, Peter Abraham

Publisher Resources

ISBN: 9781789139006Supplemental Content