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

Set initial light gain to lowest #26

Merged
merged 4 commits into from
Feb 26, 2024

Conversation

standsi
Copy link
Contributor

@standsi standsi commented Nov 8, 2023

The VEML7700 learn guide says the default gain is 1/8x in the library. It appears though it is really 1x which is the 0-index in the enumeration; the backing variable for the light_gain value is an int and defaults to 0 which is the 1x. So while the learn guide could be changed it would seem to make more sense to set the value to the 1/8x in the class constructor. This is what the vendor recommends in the app note noted in the learn guide so that the sensor is not put into overflow if it has a bright light when initialized.

@tekktrik tekktrik requested a review from a team December 27, 2023 01:19
@tannewt
Copy link
Member

tannewt commented Jan 17, 2024

@FoamyGuy What do you think about this? Changing the default gain will match the learn guide but break existing code if it uses .light.

@tekktrik tekktrik linked an issue Jan 17, 2024 that may be closed by this pull request
Copy link
Contributor

@FoamyGuy FoamyGuy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. I think matching the Learn guide and manufacturer default of 1/8th gain is best even though it means a change in behavior for things that use this library.

When I release this I'll bump the major version and note in the release notes that the default gain value is changed to match documentation and it could result in different values for the light property under the same lighting conditions.

I did a quick grep in the LearningSystem repo and did not find any usages of the VEML7700 library so there is nothing in there that will need adjusting it seems.

@FoamyGuy FoamyGuy merged commit 9977ed5 into adafruit:main Feb 26, 2024
1 check passed
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Feb 27, 2024
Updating https://github.com/adafruit/Adafruit_CircuitPython_ADXL37x to 1.1.9 from 1.1.8:
  > Merge pull request adafruit/Adafruit_CircuitPython_ADXL37x#5 from FoamyGuy/fix_readme

Updating https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI to 7.0.0 from 6.1.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_ESP32SPI#188 from justmobilize/remove-set-socket

Updating https://github.com/adafruit/Adafruit_CircuitPython_GUVX_I2C to 1.0.7 from 1.0.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_GUVX_I2C#5 from FoamyGuy/fix_readme

Updating https://github.com/adafruit/Adafruit_CircuitPython_OV5640 to 1.1.16 from 1.1.15:
  > Merge pull request adafruit/Adafruit_CircuitPython_OV5640#30 from FoamyGuy/fix_readme

Updating https://github.com/adafruit/Adafruit_CircuitPython_PCF8574 to 1.0.9 from 1.0.8:
  > Merge pull request adafruit/Adafruit_CircuitPython_PCF8574#8 from FoamyGuy/fix_readme

Updating https://github.com/adafruit/Adafruit_CircuitPython_PCF8575 to 1.0.5 from 1.0.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_PCF8575#7 from FoamyGuy/fix_readme

Updating https://github.com/adafruit/Adafruit_CircuitPython_SPD1656 to 0.9.0 from 0.8.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_SPD1656#7 from prcutler/root-group-fix

Updating https://github.com/adafruit/Adafruit_CircuitPython_ST7735 to 1.2.13 from 1.2.12:
  > Merge pull request adafruit/Adafruit_CircuitPython_ST7735#19 from prcutler/root-group-fix

Updating https://github.com/adafruit/Adafruit_CircuitPython_UC8151D to 1.3.3 from 1.3.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_UC8151D#13 from FoamyGuy/fix_readme

Updating https://github.com/adafruit/Adafruit_CircuitPython_VEML7700 to 2.0.0 from 1.1.22:
  > Merge pull request adafruit/Adafruit_CircuitPython_VEML7700#26 from standsi/SetInitialLightGain

Updating https://github.com/adafruit/Adafruit_CircuitPython_VL53L1X to 1.1.14 from 1.1.13:
  > Merge pull request adafruit/Adafruit_CircuitPython_VL53L1X#16 from analogic/patch-1

Updating https://github.com/adafruit/Adafruit_CircuitPython_VL53L4CD to 1.2.0 from 1.1.7:
  > Merge pull request adafruit/Adafruit_CircuitPython_VL53L4CD#9 from markkamp/measurement_quality

Updating https://github.com/adafruit/Adafruit_CircuitPython_BLE_Beacon to 1.0.5 from 1.0.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_BLE_Beacon#3 from FoamyGuy/fix_circup_readme

Updating https://github.com/adafruit/Adafruit_CircuitPython_PortalBase to 2.0.0 from 1.16.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_PortalBase#100 from justmobilize/remove-set-socket

Updating https://github.com/adafruit/Adafruit_CircuitPython_Radial_Controller to 1.0.12 from 1.0.11:
  > Merge pull request adafruit/Adafruit_CircuitPython_Radial_Controller#3 from FoamyGuy/fix_readme

Updating https://github.com/adafruit/Adafruit_CircuitPython_Requests to 3.0.0 from 2.0.5:
  > Merge pull request adafruit/Adafruit_CircuitPython_Requests#151 from justmobilize/connection-manager

Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA:
  > Updated download stats for the libraries
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.

Recommend setting initial light gain to lowest
3 participants