MrYsLab / pymata4

A High Performance Python Client For Arduino Firmata
GNU Affero General Public License v3.0
76 stars 30 forks source link

Encoder support #25

Closed edokun closed 3 years ago

edokun commented 3 years ago

Hi, I would like to ask if there is support to read data from rotary encoders, I try to replicate some code used in arduino but using it on python, but the results are not reliable, I saw there was some support on old version of pymata but not in this latest release.

MrYsLab commented 3 years ago

Hi Eduardo. You are correct, at one time I did support a rotary encoder, however, the Arduino libraries I used to support the feature changed over time and I could no longer get reliable results. Therefore I removed the feature. The other libraries I found involved timing events which would result in blocking the Firmata sketch. If you find a reliable encoder library that does not block, I can point you to two articles that describe how to extend both the sketch and the Python client. The first article is rather old, but the principles are the same for pymata4. The second is specifically for pymata4.

I have been working on an alternative to Firmata that I call Telemetrix. It is much simpler to extend than Firmata. There is a tutorial in the User's Guide that explains how to extend its functionality.

I will be closing this issue, but if you have any questions or further comments, you may post them here and I will see them.