l293d icon indicating copy to clipboard operation
l293d copied to clipboard

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

Open twinstef opened this issue 4 years ago • 3 comments

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.

twinstef avatar Apr 15 '20 16:04 twinstef

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

jmsv avatar Apr 21 '20 16:04 jmsv

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.

twinstef avatar Apr 21 '20 17:04 twinstef

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

jmsv avatar Apr 21 '20 19:04 jmsv