single pin encoder support
Closed this issue · 5 comments
tinyboxxx commented
Hi, Nice work!
I want use this in my speedo project, is it possible to attach a single pin encoder? I only need one direction.
I didn't find related ways to do it in document.
Thanks!
madhephaestus commented
tinyboxxx commented
thanks for your quick reply,
I did noticed that attachSingleEdge function, but one question:
Since I only got one signal pin, but which pin should I put into bPinNumber ?
thanks again.
madhephaestus commented
The same pin number :)
…On Wed, Sep 8, 2021, 9:15 AM tinyboxxx ***@***.***> wrote:
thanks for your quick reply,
I did noticed that attachSingleEdge function, but one question:
Since I only got one signal pin, but which pin should I put into
bPinNumber ?
thanks again.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#47 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJSKRVGZFM4LQTYKENNBITUA5OYBANCNFSM5DO3BHEQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
tinyboxxx commented
huge Thanks!
tinyboxxx commented
Hello, I got error when ESP32 booting, in serial.
E (719) pcnt: pcnt_unit_config(57): PCNT pluse input io error
E (720) pcnt: pcnt_unit_config(57): PCNT pluse input io error
E (720) pcnt: pcnt_unit_config(57): PCNT pluse input io error
E (725) pcnt: pcnt_unit_config(57): PCNT pluse input io error
ESP32 does keep running. Any idea what cause this error? Does some GPIO I can't use?
Thanks.
Code I use:
#include <ESP32Encoder.h>
ESP32Encoder encoder_speed;
ESP32Encoder encoder_rpm;
//in setup:
ESP32Encoder::useInternalWeakPullResistors = UP;
encoder_speed.attachSingleEdge(27, 27); // SPD
encoder_rpm.attachSingleEdge(34, 34); // RPM
//in loop:
PulseCounter_SPD = (int32_t)encoder_speed.getCount();
PulseCounter_RPM = (int32_t)encoder_rpm.getCount();