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.