Skip to content

Instantly share code, notes, and snippets.

@iotguider
Created September 13, 2017 09:11
Show Gist options
  • Save iotguider/b5e30182b3dde08044449159c72922fd to your computer and use it in GitHub Desktop.
Save iotguider/b5e30182b3dde08044449159c72922fd to your computer and use it in GitHub Desktop.
Code for H-Bridge Motor Driver in Raspberry Pi using python
import RPi.GPIO as GPIO
from time import sleep
GPIO.setmode(GPIO.BOARD)
input1 = 3
input2 = 5
enable = 8
GPIO.setup(input1,GPIO.OUT)
GPIO.setup(input2,GPIO.OUT)
GPIO.setup(enable,GPIO.OUT)
GPIO.output(input1,GPIO.HIGH)
GPIO.output(input2,GPIO.LOW)
GPIO.output(enable,GPIO.HIGH)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment