Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation for the Potentiometer module included with KMK #638

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

NiceManiac
Copy link

KMK includes a potentiometer module, potentiometer.py, but this does not have any documentation. i have written up some basic documentation for this module after some digging and reverse engineering, to help people who are not as persistent as me.

added documentation for the potentiometer.py module with examples
updated formatting
@xs5871
Copy link
Collaborator

xs5871 commented Nov 2, 2022

First off: thank you so much for taking the time to add to the documentation. That's one of our weak points, and it's very appreciated.

This is where I see a problem:
The potentiometer code is kind of old, a bit weird, should really have a different name (and cover all continuous / ADC peripherals); and the examples in your documentation use interfaces that are likely to be deprecated soonish.
I don't want to just throw away your work, not only because it's obviously covering some of our blind spots, but also because some of that example code may have a place in a hypothetical "proper" analog module. I also don't want to merge something that I know I have to completely rewrite at some point.

If you're up for a dive and want to help me improve our handling of analog peripherals, that'd be awesome.
If not, we can discuss just the doc contribution and get a bit polished and somewhat more future proof.

@NiceManiac
Copy link
Author

The potentiometer module is a bit weird, but it does work at least for now for analog signals, even if it relies on deprecated code to make it run.
I do agree that the module probably should be renamed, maybe to analog or something similar as it does apply to any analog signal coming thru the ADC ports.
I mainly just wanted to write down my findings in case anyone else was interested in getting potentiometers to work with KMK, although i am still trying to work out a good way to add a controller HID device to be able to also output analog data as controller joysticks to the pc.
As for improving the handling of analog signals i will have to do some reading on how circuitpython handles analog signals, which at the moment i don't really have time to get fully educated on, but in the meantime i think that we should be able to get the doc contribution into a useful state. as i have stated i havent analyzed the entire codebase so my writeup only included what i have managed to figure out from my evening hairpulling while trying to get my board to do what i wanted. Ofc if there is any newer features that might improve the way the module works i would be really interested in learning more about how KMK works, and also improving the documentation.

@xs5871
Copy link
Collaborator

xs5871 commented Nov 3, 2022

That sounds great. Give me a couple of days to give this a proper look at. We may have to change the pot module a tiny bit to get to an MVP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants