-
Notifications
You must be signed in to change notification settings - Fork 401
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
RotaryEncoder based on gpiozero #763
RotaryEncoder based on gpiozero #763
Conversation
new gpio_control add gpio_settings.ini in settings
I like the clear separation, this could make maintenance easier in the future. General question: should the Python tests be located in ./scripts/tests, because there's already a directory ./test (which contains only some shell tests)? Additionally the defined Python tests could be used in GitHub Actions, so tests are executed at every commit. See https://github.com/MiczFlor/RPi-Jukebox-RFID/blob/develop/.github/workflows/pythonpackage.yml |
With the separation of the settings from the py file, could renaming of gpio-buttons py.sample to py during installation also be dropped? |
This PR should probably be synchronized with PR #387 |
Hi @veloxidSchweiz @s-martin @ZyanKLee a) the Apple way
b) the Android way
I think (b) is kind of happening elsewere, but with no config / API standards. @veloxidSchweiz suggested something here for GPIO in yaml style. Option (a) might be an easier way to separate the entry level Phonieboxers from the experts. Am I missing more options? Please share. |
Hi @MiczFlor, @s-martin P.S.: What definitely makes sense is to check how good the different modules are actually tested. if one for examples looks in the code of gpiozero, one sees that this has many unittests which also gives a certain confidence that one can work with that module. |
Hi @veloxidSchweiz a year ago I removed carefully gpio.zero for performance reasons: |
I think the strength of this project is that is highly configurable and limiting it to only a few configurations would limit the potential. I think, if we get some automated testing done, then stability would improve. |
If we think bigger, not just GPIO, then a configuration would also need to take into account different soundcards (which in the past have often proven to be the reason for sudden GPIO problems, since they take up GPIO pins at times used in some of the existing scripts). |
I agree on that, and by having standard configurations prepared we actually have the
Hi @martinclausen2 , |
start pytests for RotaryEncoder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I
scripts/gpio_control.py
Outdated
import configparser | ||
import logging | ||
|
||
import mock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this import necessary?
scripts/RotaryEncoder.py
Outdated
#!/usr/bin/python3 | ||
# rotary volume knob | ||
# these files belong all together: | ||
# RPi-Jukebox-RFID/scripts/rotary-encoder.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having files RotaryEncoder.py and rotary-encoder.py may be confusing or do you intend to merge these files?
Hi @s-martin, |
new gpio_control add gpio_settings.ini in settings
start pytests for RotaryEncoder
f18d7e8
to
b10d64f
Compare
…/veloxidSchweiz/RPi-Jukebox-RFID into feature/configureableGPIOButtons
…/veloxidSchweiz/RPi-Jukebox-RFID into feature/configureableGPIOButtons
The state machine tracks more than just the current state (=>more than one transition of the A and B output) and can thereby avoid to issue commands if the encoder just flickers back an forth. The code also uses the speed for a feature that I call acceleration: The faster you turn the more the output variable is changed per pulse from the encoder. |
…s' into feature/configureableGPIOButtons # Conflicts: # components/gpio_control/gpio_control.py
…r rotary_encoders
Hi @veloxidSchweiz @ZyanKLee @s-martin @martinclausen2 |
Hey,
As already mentioned once, I think it would be great to build up a configurable gpio_control using configfiles.
After some different ways of implementation, here is a rough idea how this could look like later.
What I am still want to improve, is the way how the functionCalls are connected with the buttons, especially when one wants to use a oled display as well. Here I am thinking about a way that one can register functioncalls and then can be used later on. This will be one of the next steps.
At the moment I do not want to have this branch merged.
I just want to have a Feedback what you think about this structure....
In order to simplify testing I am using a different implemntation of the RotaryEncoder using gpiozero. Using only one gpio interface is in my opinion prefarable. (I actually hope/think that this implementation will be integrated in the gpiozero class sooner or later)
WOuld be glad about any kind of feedback