Created
March 27, 2017 19:33
-
-
Save keithweaver/4e40888cab12a9eadd7a30a0d5477090 to your computer and use it in GitHub Desktop.
Example of using L293D Python Library
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
# Run the following commands in the terminal/command line: | |
# pip install l293d | |
# or (I had to run as root): | |
# sudo pip install l293d | |
# | |
# I also needed to install Yaml | |
# So: | |
# pip install pyyaml | |
# or I had to run with sudo: | |
# sudo pip install pyyaml | |
import l293d.driver as l293d | |
# Motor 1 uses Pin 22, Pin 18, Pin 16 | |
motor1 = l293d.motor(22,18,16) | |
# Motor 2 uses Pin 15, Pin 13, Pin 11 | |
motor2 = l293d.motor(15,13,11) | |
# Run the motors so visible | |
for i in range(0,150): | |
motor1.clockwise() | |
motor2.clockwise() | |
l293d.cleanup() |
Hi @RangoCode, l293d
has changed a bit since this Gist was made. Check out l293d.readthedocs.io to get started. The repo for this library can be found here: github.com/jmsv/l293d.
Feel free to open an issue if you need any help 😃
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I need help. It says
Traceback (most recent call last):
File "/home/pi/motortest.py", line 3, in
motor1 = l293d.motor(16,18,22)
AttributeError: 'module' object has no attribute `'motor'```