Skip to content

Instantly share code, notes, and snippets.

Avatar

Duckida duckida

  • CA
View GitHub Profile
View AdaMotor.py
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT
# Use this example for digital pin control of an H-bridge driver
# like a DRV8833, TB6612 or L298N.
import time
import board
import digitalio
from adafruit_motor import stepper
View motor2.py
import RPi.GPIO as gpio
import time
gpio.setmode(gpio.BCM)
gpio.setwarnings(False)
# Pins
ain1 = 16
ain2 = 20
View motortest.py
# Import required modules
import time
import RPi.GPIO as GPIO
# Declare the GPIO settings
GPIO.setmode(GPIO.BOARD)
# set up GPIO pins
GPIO.setup(7, GPIO.OUT) # Connected to PWMA