MrYsLab / PyMata

A Python client class library for Interaction with Standard Firmata
GNU Affero General Public License v3.0
95 stars 40 forks source link

set_pin_mode overwrites previous pin state value #45

Closed chriski777 closed 4 years ago

chriski777 commented 4 years ago

Hi,

I ran into this issue where I'm trying to set the pin modes for two pins that correspond to the same pin number but are different types of pins (e.g: digital PWM pin 4 and analog input pin 4).

self._board.set_pin_mode(4, PyMata.PWM, PyMata.DIGITAL)
self._board.set_pin_mode(4, PyMata.INPUT, PyMata.ANALOG)

However, once I run these two lines, it seems that the second line simply overwrites the first line and I am unable to use the digital PWM pin.

MrYsLab commented 4 years ago

I can confirm what you are seeing. I will investigate and will provide a fix within the next few days.

MrYsLab commented 4 years ago

Fixed with release 2.20. Thanks for reporting the issue.

chriski777 commented 4 years ago

works great now. Thanks!