For our first demonstration of the Raspberry Pi along with the GoPiGo board, we built a few example setups. To begin with, the Raspberry Pi board needed to be setup by updating the firmware and attaching it to the GoPiGo board. Once that setup was complete the motors were attached to the board and mounted with wheels. The first demonstration piece of code, shown below and demonstrated in the video, controls the wheels and LEDs on the robot. First, the LEDs which make up the GoPiGo's eyes illuminate for two seconds. Next, the eyes shut and the right motor begins to spin while the right red LED turns on. The motor stops spinning when the LED turns off, and then the left motor and LED receive turn on. After another two seconds, the code prints "Done" and the program completes.
To further demonstrate our control of the robot, we next attached more sensors that we could manipulate. We connected a pushbutton to the Analog/Digital 2 pin, and programmed this button to enable or disable the motors. The photoresistor was then wired to the Analog/Digital 1 pin and the output of the sensor used to proportionately actuate both motors. The two wheels spin faster when the sensor is exposed to light, and they slow down as the photoresistor is covered. The motor speeds are printed by the code, which is shown below. Demonstration of this operation is also shown in the video below.