[Logo for The C Shore Landing Page]
The C Shore

Basic Operation

Now that we can talk to our Raspberry Pi, we need to find out if we have built it correctly. When you tell your RoboCar to go forward, Raspberry Pi does not understand what forward means.  You have to show it.

Step One – Turn on Robo-Car (may have been done already)

  1. Turn the Robo-Car on and observe the RoboCar is ready
  2. All three red lights on and the green LED on the Raspberry Pi is no longer flashing
  3. Place you Robo-Car on the hoist block so its wheels are not touching the table.

Step Two – Turn on and Connect Laptop (may have been done already)

Turn on your computer and start the wireless VNC application.  Log into the Raspberry Pi as a remote connection user.

Step Three – Load Test File

We now need to find out if the RoboCar will go forward and backward as commanded.

  1. Click raspberry Pi icon at top left
  2. Click on Applications
  3. Click on Mu
  4. Click on Open and select the file GoForward.py.  Double click that file
  5. The file will now be displayed in the Mu window. It should look like:
    
    from gpiozero import Robot
    import time
    
    roboCar = Robot(left=(7,8)), right=(9,10))
    roboCar.forward()
    time.sleep(2)
    roboCar.stop()
    
    

Step Four – Test Forward/Backward

Ensure your RoboCar is on the hoist block. Make sure the wheels are free to turn without hitting anything. Run the application and observe if any of the wheels are turning in reverse (would make the RoboCar go backwards).

Stop the application.  At the motor controller, loosen the two wires that come from the wheel that is going backwards. Reverse the two wires and tighten the screws. Rerun the Step Four test until both wheels turn in a forward direction. Remember if you turned off the RoboCar at the switch you will have to go through the three step VNC procedure again to regain communication.

Step Five – Test Left/Right

We now need to find out if the RoboCar will go left and right as commanded.

  1. Click raspberry Pi icon at top left
  2. Click on Applications
  3. Click on Mu
  4. Click on Open and select the file GoLeft.py. Double click that file

The file will now be displayed in the Mu window. It should look like:

  
from gpiozero import Robot
import time
roboCar = Robot(left=(7,8)), right=(9,10))
roboCar.left()
time.sleep(2)
roboCar.stop()

If the command is working properly the wheel on the right side of the chassis board (looking from the back) should turn forward and the wheel on the left side should be turning backwards. If that is not the case, you need to make a change to the program.

Change the line

roboCar = Robot(left=(7,8), right=(9,10))

to

roboCar = Robot(left=(9,10), right=(7,8))

Note, if you need to make this change, you will have to make the same change to all future programs you write for your RoboCar.