Skip to content

Instantly share code, notes, and snippets.

@MarcScott
Created April 28, 2021 17:26
Show Gist options
  • Save MarcScott/cda6e28dbf2a5a1a10ea11c8834cb6c9 to your computer and use it in GitHub Desktop.
Save MarcScott/cda6e28dbf2a5a1a10ea11c8834cb6c9 to your computer and use it in GitHub Desktop.
Forward, backward pico buggy
from machine import Pin
import utime
motor_left_FORWARD=Pin(7, Pin.OUT)
motor_left_BACKWARD=Pin(8, Pin.OUT)
motor_right_FORWARD=Pin(9, Pin.OUT)
motor_right_BACKWARD=Pin(10, Pin.OUT)
motor_left_FORWARD.value(1)
motor_right_FORWARD.value(1)
utime.sleep(3)
motor_left_FORWARD.value(0)
motor_right_FORWARD.value(0)
utime.sleep(3)
motor_left_BACKWARD.value(1)
motor_right_BACKWARD.value(1)
utime.sleep(3)
motor_left_BACKWARD.value(0)
motor_right_BACKWARD.value(0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment