Created
September 13, 2017 09:11
-
-
Save iotguider/b5e30182b3dde08044449159c72922fd to your computer and use it in GitHub Desktop.
Code for H-Bridge Motor Driver in Raspberry Pi using python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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