-
Notifications
You must be signed in to change notification settings - Fork 64
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
Deinitialize pulsein object on exit, gave option to choose whether or not to use pulseio #46
Conversation
… not to use pulseio
Tried to test but my pi was not cooperating |
@dherrada I tested this on a Pi 4B+ with a DHT22 both with and without pulseio. It works both ways but I did see more checksum errors without pulseio. use_pulseio=False
use_pulseio=True
|
I also test this on a feather_m4_express and the bitbang does not work at all use_pulseio=False
use_pulseio=True
|
@jerryneedell Ok. I think I'll add a comment somewhere in the example that explains this. |
I think so. The learn guide (https://learn.adafruit.com/dht/dht-circuitpython-code#step-2980241) says it should work on any pin with PWM support, which, on the M4, is most of them (https://learn.adafruit.com/assets/78438), and, on the M0, is a lot of them (https://learn.adafruit.com/assets/46247). |
tested updated PR on Raspberry Pi 4B= with DHT 22
also tested using pulseio on feather m4_express -- worked normally. |
@jerryneedell Do you think it's worth taking a deeper look into the bitbang issue on CircuitPython? Is there a valid reason that anyone would want to use the bitbang method over pulseio? |
Since bitbang does not appear to work under CP and I am not aware of anyone interested in fixing it, I agree it should be removed. Just throw an error if Pulseio is not available. |
@jerryneedell Ok, that's what I'll do. |
@jerryneedell To be completely honest, I didn't test this last commit outside of mock testing the if statement in the repl in circuitpython and on the raspberry pi |
In my case I had to add |
@jerryneedell Dylan is off for a while. Any chance you could take over this PR? |
I’ll take a look at it tomorrow. I kind if lost track of it. |
@kattni I have tested this on a feather_m0 (basic) and on a Raspberry Pi 4 By "taking over" this PR - did you want me to do more than this testing? I do not know what the full motivation was for this PR to begin with. The issues with bitbang seem to have eclipsed the issue related to de-init. Do you want to go ahead and merge this as it is since it appears to be working and no one else has commented on the changes. I wish there were a better way to do this since it has a large piece of code that is never used by CircuitPython (only Blinka) but I don't have anything in mind. Is the bitbang support from Blinka important enough to keep it? Let me know how you want to proceed. |
@makermelissa Can you weigh in on this? Please glance over the entire thread. The question regarding Blinka is in the comment from Jerry immediately before this one, and that's the thing I'm specifically looking for input on. Thanks! |
@jerryneedell I'm bringing in Melissa for the Blinka part of the decision. Then we can sort out where to go from here. |
If I recall correctly, bitbang was originally introduced for the RPi because pulseio was not available. See #18 and #14. Are there are some SPC's supported by Blinka that still do not have pulseio? I was just wondering if it was still useful to have. It would simplify and reduce the size the library to take it out if it is not needed. |
especially note this comment #18 (comment) |
That's a good point @jerryneedell. There are actually only a few boards (Raspberry Pi only perhaps) that have the pulseio available, so it's probably worth keeping for the other boards that don't have the hardware support. |
If we are going to keep bitbang, then I think this PR is OK - possibly with one change as noted above. |
@jerryneedell Can you please make the change you suggested? Then we can get this merged. |
OK -- I "think" I did that correctly ... |
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.
added doctoring for new kwarg - use_pulseio
tested on RPi 4
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.
Thanks everyone who worked on this!
Updating https://github.com/adafruit/Adafruit_CircuitPython_DHT to 3.5.0 from 3.4.2: > Merge pull request adafruit/Adafruit_CircuitPython_DHT#46 from adafruit/pulseio-fix Updating https://github.com/adafruit/Adafruit_CircuitPython_HCSR04 to 0.4.3 from 0.4.2: > Merge pull request adafruit/Adafruit_CircuitPython_HCSR04#21 from FoamyGuy/dannystaple-readme-patch Updating https://github.com/adafruit/Adafruit_CircuitPython_INA219 to 3.4.4 from 3.4.3: > Merge pull request adafruit/Adafruit_CircuitPython_INA219#24 from nvtkaszpir/patch-1 > Merge pull request adafruit/Adafruit_CircuitPython_INA219#23 from nvtkaszpir/patch-2 > Merge pull request adafruit/Adafruit_CircuitPython_INA219#22 from nvtkaszpir/patch-3 Updating https://github.com/adafruit/Adafruit_CircuitPython_LSM6DS to 4.1.0 from 4.0.1: > Merge pull request adafruit/Adafruit_CircuitPython_LSM6DS#20 from adafruit/lsm6dso32 Updating https://github.com/adafruit/Adafruit_CircuitPython_MS8607 to 1.0.1 from 1.0.0: > updated PID Updating https://github.com/adafruit/Adafruit_CircuitPython_PCT2075 to 1.1.4 from 1.1.3: > Merge pull request adafruit/Adafruit_CircuitPython_PCT2075#12 from garrettheath4/readme-fix Updating https://github.com/adafruit/Adafruit_CircuitPython_PM25 to 1.0.3 from 1.0.2: > Merge pull request adafruit/Adafruit_CircuitPython_PM25#6 from dglaude/patch-2 Updating https://github.com/adafruit/Adafruit_CircuitPython_PN532 to 2.2.0 from 2.1.2: > Merge pull request adafruit/Adafruit_CircuitPython_PN532#37 from dunkmann00/listen-for-passive-target Updating https://github.com/adafruit/Adafruit_CircuitPython_TLC59711 to 1.2.3 from 1.2.2: > Merge pull request adafruit/Adafruit_CircuitPython_TLC59711#14 from FoamyGuy/remove_hardcoded_baudrate Updating https://github.com/adafruit/Adafruit_CircuitPython_Bitmap_Font to 1.2.0 from 1.1.3: > Merge pull request adafruit/Adafruit_CircuitPython_Bitmap_Font#27 from FoamyGuy/adding_more_examples > Merge pull request adafruit/Adafruit_CircuitPython_Bitmap_Font#24 from FoamyGuy/fix_docs_link_in_readme Updating https://github.com/adafruit/Adafruit_CircuitPython_BLE_Adafruit to 1.2.0 from 1.1.1: > Merge pull request adafruit/Adafruit_CircuitPython_BLE_Adafruit#6 from dhalbert/fix-packet-sizes Updating https://github.com/adafruit/Adafruit_CircuitPython_Display_Text to 2.8.2 from 2.8.1: > Merge pull request adafruit/Adafruit_CircuitPython_Display_Text#88 from FoamyGuy/fix_load_glyphs_for_builtin Updating https://github.com/adafruit/Adafruit_CircuitPython_LED_Animation to 2.4.2 from 2.4.1: > Merge pull request adafruit/Adafruit_CircuitPython_LED_Animation#64 from rhooper/adjust-copyright Updating https://github.com/adafruit/Adafruit_CircuitPython_Motor to 3.2.1 from 3.1.2: > Merge pull request adafruit/Adafruit_CircuitPython_Motor#46 from caternuson/example_rename > Merge pull request adafruit/Adafruit_CircuitPython_Motor#44 from caternuson/digi_step Updating https://github.com/adafruit/Adafruit_CircuitPython_ProgressBar to 1.3.2 from 1.3.1: > Merge pull request adafruit/Adafruit_CircuitPython_ProgressBar#14 from FoamyGuy/simpletest_improvement Updating https://github.com/adafruit/Adafruit_CircuitPython_PyBadger to 3.1.0 from 3.0.1: > Merge pull request adafruit/Adafruit_CircuitPython_PyBadger#35 from FoamyGuy/adding_cpb_gizmo
I have several remarks regarding this:
I'm using a Raspberry Pi zero W, on pin D18 I can submit a PR regarding the |
No description provided.