Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python Error when call to motor.stop() before call to motor.clockwise() #94

Open
twinstef opened this issue Apr 15, 2020 · 3 comments
Open

Comments

@twinstef
Copy link

twinstef commented Apr 15, 2020

Code:
import l293d
door = l293d.DC(22, 18, 16)
door.stop()

Result:
File "/usr/local/lib/python2.7/dist-packages/l293d/driver.py", line 162, in stop
self.__move_motor(0, after, True, 'stopping', None)
File "/usr/local/lib/python2.7/dist-packages/l293d/driver.py", line 142, in __move_motor
wait=wait, speed=speed)
File "/usr/local/lib/python2.7/dist-packages/l293d/driver.py", line 103, in drive_motor
self.pwm.stop()
AttributeError: 'NoneType' object has no attribute 'stop'

Solution:
Start code with:
door.clockwise(1,wait=False)
door.stop()
To initiate variables vithout running motor.

@jmsv
Copy link
Owner

jmsv commented Apr 21, 2020

thanks for raising this issue - pretty busy at the moment but I've put it on a todo list and will hopefully get to it at some point

@twinstef
Copy link
Author

twinstef commented Apr 21, 2020 via email

@jmsv
Copy link
Owner

jmsv commented Apr 21, 2020

excellent to hear this is being put to good use! I would love to know more about your setup 😍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants