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++

Wiring connection

With a wiring connection, we can connect the LDR sensor module and a LED to the RPi:

The wiring connections are as follows:

  • wiringPi pin 8 of the RPi is connected to the D0 pin of the LDR sensor module
  • Physical pin 2 of the RPi is connected to the Vcc pin of the LDR sensor module
  • Physical pin 6 of the RPi is connected to the Gnd pin of the LDR sensor module
  • wiringPi pin 0 is connected to the positive pin of the LED
  • Physical pin 14 is connected to the negative pin of the LED

Now that we have connected the LDR sensor module and LED to the RPi, let's write the program to turn the LED on/off by taking inputs from the LDR sensor. ...

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