jmsv / l293d

Python module to drive DC motors from a Raspberry Pi using the L293D chip
http://l293d.rtfd.io
MIT License
18 stars 15 forks source link

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

Open twinstef opened 4 years ago

twinstef commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

not urgent, and thank's for your code which runs morning and evening in my chicken coop avoiding me to get up at dawn.

Stéphane

Le 21/04/2020 à 18:42, James Vickery a écrit :

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

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jmsv/l293d/issues/94#issuecomment-617275930, or unsubscribe https://github.com/notifications/unsubscribe-auth/AENLYDALL62DAWZZ4JMU6LLRNXEHNANCNFSM4MIW6G6A.

jmsv commented 4 years ago

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