You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While interfacing the ch32v003 with a rotary encoder, I could not find a quick and "easy" way to configure the input pins as pullups, so I wrote this snippet:
// configure a pin (PC5 in this case) into an input that uses pullup/down funPinMode(PC5, GPIO_Speed_In | GPIO_CNF_IN_PUPD);
// actually enable the pullupfunInputPullUpDown(PC5, FUN_INPUT_PULLUP);
...
// read the statefunDigitalRead(PC5);
I've opened this issue to share this as I thought it might come in handy. If it looks like something that could be added to ch32v003fun.h, I'll be glad to send a PR.
On a tangent, I ordered a bunch of boards for those encoders which turned up today, and they just work because of ch32v003fun. Thank you cnlohr and other contributors for making such a useful project!
The text was updated successfully, but these errors were encountered:
Hello!
While interfacing the ch32v003 with a rotary encoder, I could not find a quick and "easy" way to configure the input pins as pullups, so I wrote this snippet:
It can be used like this:
I've opened this issue to share this as I thought it might come in handy. If it looks like something that could be added to
ch32v003fun.h
, I'll be glad to send a PR.On a tangent, I ordered a bunch of boards for those encoders which turned up today, and they just work because of ch32v003fun. Thank you cnlohr and other contributors for making such a useful project!
The text was updated successfully, but these errors were encountered: