After controlling the LEDs and the buzzer, let's write a program for controlling our rover (the robot) from our laptop:
I have kept the wiring connections the same as they were in Chapter 3, Programming the Robot:
- The wiringPi pin numbers 0 and 2 are connected to the IN1 and IN2 pins
- The wiringPi pin numbers 3 and 4 are connected to the IN3 and IN4 pins
- The left motor pins are connected to the OUT1 and OUT2 pins of the motor driver
- The right motor pins are connected to the OUT3 and OUT4 pins of the motor driver
- Pin 6 of the Raspberry Pi is connected to the ground socket of the motor driver