Skip to content

Fix proximity read frequency #22

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

Merged
merged 4 commits into from
Feb 6, 2022

Conversation

stonehippo
Copy link
Contributor

@stonehippo stonehippo commented Feb 6, 2022

Previously, the module used an incorrect register to set the proximity
modulator timing of the chip, rather than the number of proximity
reads per second.

This change updates the getter and setter for frequency to use the
correct proximity rate register, and adds a modulation property to
continue to provide access to that register (though it probably should
be left at the default)

This should address #21

Previously, the module used an incorrect register to set the proximity
modulator timing of the chip, rather than the number of proximity
reads per second.

This change updates the getter and setter for frequency to use the
correct proximity rate register, and adds a modulation property to
continue to provide access to that register (though it probably should
be left at the default)
@stonehippo
Copy link
Contributor Author

@ladyada as requested, here’s the PR for the proximity fix. I’ve left modulation in, even though it’s probably never going to be needed.

@ladyada
Copy link
Member

ladyada commented Feb 6, 2022

oh oh, we see whats up. sorry for the mixup - can you keep the 'modulation' setting called 'frequency' but change whatcha have called 'frequency' into samplerate?

Restoring the original `frequency` property to refer to the proximity
modulator timing (to keep from making a breaking change to the API)
and renamed the new property to `samplerate`.
@stonehippo
Copy link
Contributor Author

stonehippo commented Feb 6, 2022

Got it. You don't want to redefine frequency and break the existing API. ;-)

I've restored frequency and changed the measurements per second to samplerate.

Black flagged some lines with extra spaces
@stonehippo
Copy link
Contributor Author

stonehippo commented Feb 6, 2022

Ok, I think this is all set, @ladyada, unless you've got more feedback. Tested on an RP2040 Trinkey and in Blinka on an RPi Zero W.

@ladyada
Copy link
Member

ladyada commented Feb 6, 2022

welll... it didnt work at all before right? so is it really breaking an api if it was already broken :)

@ladyada ladyada merged commit 786521f into adafruit:main Feb 6, 2022
@ladyada
Copy link
Member

ladyada commented Feb 6, 2022

thank u!

@evaherrada this is a breaking change so plz bump major vers :)

@stonehippo stonehippo deleted the proximity_frequency_read_fix branch February 6, 2022 20:27
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Feb 11, 2022
Updating https://github.com/adafruit/Adafruit_CircuitPython_AS7341 to 1.2.3 from 1.2.2:
  > Consolidate Documentation sections of README
  > Merge pull request adafruit/Adafruit_CircuitPython_AS7341#22 from Neradoc/patch-1

Updating https://github.com/adafruit/Adafruit_CircuitPython_VCNL4010 to 0.11.0 from 0.10.10:
  > Consolidate Documentation sections of README
  > Merge pull request adafruit/Adafruit_CircuitPython_VCNL4010#22 from stonehippo/proximity_frequency_read_fix

Updating https://github.com/adafruit/Adafruit_CircuitPython_BLE_BroadcastNet to 0.12.0 from 0.11.1:
  > Consolidate Documentation sections of README
  > Merge pull request adafruit/Adafruit_CircuitPython_BLE_BroadcastNet#27 from tekktrik/feature/use-ble-consts

Updating https://github.com/adafruit/Adafruit_CircuitPython_BLE_Adafruit to 1.4.0 from 1.3.3:
  > Consolidate Documentation sections of README
  > Merge pull request adafruit/Adafruit_CircuitPython_BLE_Adafruit#19 from tekktrik/feature/use-ble-consts

Updating https://github.com/adafruit/Adafruit_CircuitPython_BLE_LYWSD03MMC to 1.0.5 from 1.0.4:
  > Consolidate Documentation sections of README
  > Merge pull request adafruit/Adafruit_CircuitPython_BLE_LYWSD03MMC#4 from tekktrik/doc/add-typing

Updating https://github.com/adafruit/Adafruit_CircuitPython_BusDevice to 5.1.3 from 5.1.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_BusDevice#76 from tekktrik/doc/consolidate-readme
  > Merge pull request adafruit/Adafruit_CircuitPython_BusDevice#75 from tekktrik/doc/add-typing

Updating https://github.com/adafruit/Adafruit_CircuitPython_Display_Text to 2.22.0 from 2.21.4:
  > Post-patch cleanup
  > Consolidate Documentation sections of README
  > Merge pull request adafruit/Adafruit_CircuitPython_Display_Text#164 from FoamyGuy/scrolling_label

Updating https://github.com/adafruit/Adafruit_CircuitPython_MagTag to 2.1.7 from 2.1.6:
  > Consolidate Documentation sections of README
  > Merge pull request adafruit/Adafruit_CircuitPython_MagTag#78 from VPTechOps/VPTechOps
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.

2 participants