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
Fixed length pin string names #180
Comments
@PeteLawler i know @jadonk wants to see these values converted to a mixed case option, with leading/no-leading 0's and mixed symbols: '.','_', etc.. https://github.com/adafruit/adafruit-beaglebone-io-python/blob/master/source/common.c#L73-L261 and @pdp7 is working on splitting that single table up into a per board table. Regards, |
@RobertCNelson |
@PeteLawler that does seem awkward to have For reference, |
@pdp7 and config-pin already does this internal pin name fixup: Probably steal some of that syntax. ;) Regards, |
Ah great I was pretty sure I'd seen that nomenclature somewhere but after this adventure I really wondered. Had a brief squizz at the SRM, didn't see anything, then went back to coffee. |
Considering the audience, i don't mind, P8_01/P8_1/P8.01/P8.1.. it's just implementing that in python.. ;) bash is easy.. |
Please note that there is no '0' prefix for the pin numbers. For example, pin 7 on header P8 is "P8_7"
I've added documentation to the README that there is no '0' prefix for the pin numbers. I'm going to close this issue but would be happy to review any pull requests that add logic for alternate formats for pin labels. |
Features: * Issue #194: Encoder position cannot be set * PR #205: Encoder: add support for reading/writing sysfs attributes Fixes: * Issue #198: use https for DEFAULT_URL in distribute_setup.py * Issue #197: Fix leak of pwm enable file descriptor * Issue #189: Fix seg fault of PWM in Python 3.6 * Issue #180: Clarify there is no 0 prefix for pin lables * PR #201: Encoder: do kernel check, PEP8 cleanup * PR #202: Encoder: corrected kernel check logic * PR #207: Encoder: improved usage adocumentation * PR #210: Encoder: fix sysfs import, make code Python 3 compatible * PR #212: Encoder: fix Python 3 compatibility * PR #213: Encoder: fix frequency calculation from period shortlog: * David Planella (18): * Encoder: initialize only the given channel * Sync from master * Encoder: do kernel check, PEP8 cleanup * Encoder: added sysfs module * Encoder: use sysfs to write QEP attributes * Encoder: corrected kernel check logic * Merge pull request #2 from adafruit/master * Encoder: convert get/set methods to properties, update apidoc strings * Encoder: updated README * Encoder: add README apt install clarification * Encoder: copyright assignment note, updated comments * Encoder: added usage notes * Encoder: improved usage documentation * Encoder: minor fix to usage example * Encoder: added a note about permissions * Encoder: switched sysfs to be a relative import compatible with Python 2 and 3 * Encoder: use items() instead of iteritems() to be Python 3 compatible * Encoder: fix frequency getter * Drew Fustini (18): * use https for DEFAULT_URL in distribute_setup.py (#198) * fix except syntax for Python 3 * use dict.items() instead of dict.iteritems() for Python 3 * fix error in set_brightness() * close enable_fd when stopping PWM output (#197) * Merge pull request #199 from dplanella/patch-1 * Fix leak of pwm enable file descriptor (#197) * Merge pull request #201 from dplanella/encoder-cleanup * remove test_rotary.py as not valid for pytest * Fix seg fault of PWM in Python 3.6 (#189) * Merge pull request #202 from dplanella/patch-2 * Clarify there is no 0 prefix for pin lables (#180) * Merge pull request #205 from dplanella/encoder-sysfs * assign copyright for new file to Adafruit Industries * Add bash scripts to help install and test * Merge pull request #212 from dplanella/patch-4 * Merge pull request #207 from dplanella/patch-3 * Merge pull request #213 from dplanella/fix-encoder-frequency Signed-off-by: Drew Fustini <drew@pdp7.com>
So I'm of the habit that when I'm dealing with numbers or strings of generally a specified length, that I include leading 0's if needs be.
Thus in a numbering scheme where we go from 0 to 99, I'll tend to use 00, 01, 02, 03... etc. up to 99. This can make, if I need to, string manipulation easier.
After a month or two of tracking down a 'bug', I've finally nailed it. Can you see where I'm going?
Bug:
SystemError: returned NULL without setting an error
Cause:
GPIO.setup("P8_07", OUT )
Fix:
GPIO.setup("P8_7", OUT )
I'm wondering if, apart from within source, this should be noted on the README, or whether the source could be updated. I'm not sure about the latter because I don't quite know about external compatibilies you may be wishing to maintain. I'm happy to do any diff, just eager for any guidance....
I can't believe... ok I can... that it took this long to track down.
The text was updated successfully, but these errors were encountered: