Pivoting the Raspberry Pi Car




def pivot_left(tf):
    init()
    gpio.output(13, True)
    gpio.output(15, False)
    gpio.output(7, True)
    gpio.output(11, False)
    time.sleep(tf)
    gpio.cleanup()
    

def pivot_right(tf):
    init()
    gpio.output(13, False)
    gpio.output(15, True)
    gpio.output(7, False)
    gpio.output(11, True)
    time.sleep(tf)
    gpio.cleanup()
		

Here, we're just adding a couple pivot functions. I've just included these for quick reference, feel free to copy and paste them into your main script.

The next tutorial:





  • Robotics with the Raspberry Pi
  • Programming GPIO example
  • Running GPIO
  • Building Autonomous / RC car intro
  • Supplies needed
  • Motor Control
  • Connecting the four motors
  • Forward and Reverse
  • Turning
  • Pivoting
  • User Control
  • Remotely controlling the car
  • Adding a distance sensor (HC-SR04)
  • Programming with the distance sensor
  • Autopilot and/or auto-correct
  • Autonomous Beginnings
  • Testing Autonomous Code
  • Streaming video example one
  • Less latency streaming option