-
Notifications
You must be signed in to change notification settings - Fork 15
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
Sensor Overflow Logic fix #6
Conversation
…ensor overflowed
…htly higher values when in the 100 ms atime setting
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.
One small thing then it'll be good to go. Thanks!
adafruit_tsl2591.py
Outdated
@@ -69,6 +69,8 @@ | |||
_TSL2591_LUX_COEFB = 1.64 | |||
_TSL2591_LUX_COEFC = 0.59 | |||
_TSL2591_LUX_COEFD = 0.86 | |||
_TSL2591_MAX_COUNT_100MS = const(36863) |
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.
Please rewrite this number as 0x8fff to match the one below.
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.
Any aversion to writing the one below to 65535 to reflect what is in the datasheet. This way one can search for 36863 and find it in the datasheet as well as 65535, whereas the hex values are nowhere to be found in the datasheet.
See Control Register (0x01) in the TSL2591 datasheet
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.
How about writing one as a comment and one as a constant?
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.
Put the comments in for the hex representation as well
…nd allow for "copy/search" within it.
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.
Awesome! Thank you so much!
Updating https://github.com/adafruit/Adafruit_CircuitPython_ADS1x15 to 0.5.3 from 0.5.2: > Merge pull request adafruit/Adafruit_CircuitPython_ADS1x15#18 from adafruit/pypi-readme-update Updating https://github.com/adafruit/Adafruit_CircuitPython_AMG to 1.1.1 from 1.1.0: > ignore the board module imports in .pylintrc > Update rpi_thermal_cam.py > Update rpi_thermal_cam.py > Update rpi_thermal_cam.py > Merge pull request adafruit/Adafruit_CircuitPython_AMG#9 from kattni/example-update > DM: my man pylint > DM: make travis happy > DM: add blinka thermal cam example Updating https://github.com/adafruit/Adafruit_CircuitPython_APDS to 1.1.2 from 1.1.1: > Merge pull request adafruit/Adafruit_CircuitPython_APDS#9 from adafruit/pypi-readme-update > ignore the board module imports in .pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_AS726x to 1.0.3 from 1.0.2: > Merge pull request adafruit/Adafruit_CircuitPython_AS726x#5 from adafruit/pypi-readme-update > ignore the board module imports in .pylintrc > Merge pull request adafruit/Adafruit_CircuitPython_AS726x#4 from adafruit/pypi_readme Updating https://github.com/adafruit/Adafruit_CircuitPython_BME280 to 2.2.0 from 2.1.0: > Merge pull request adafruit/Adafruit_CircuitPython_BME280#16 from adafruit/pypi-readme-update > ignore the board module imports in .pylintrc > Merge pull request adafruit/Adafruit_CircuitPython_BME280#13 from adafruit/revert-12-add-dew-point Updating https://github.com/adafruit/Adafruit_CircuitPython_BME680 to 3.0.6 from 3.0.5: > ignore the board module imports in .pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_BMP280 to 3.0.9 from 3.0.8: > Merge pull request adafruit/Adafruit_CircuitPython_BMP280#10 from adafruit/pypi-readme-update Updating https://github.com/adafruit/Adafruit_CircuitPython_CCS811 to 1.1.3 from 1.1.2: > ignore the board module imports in .pylintrc > Merge pull request adafruit/Adafruit_CircuitPython_CCS811#24 from kattni/update-example > Merge pull request adafruit/Adafruit_CircuitPython_CCS811#23 from adafruit/fix_module_caps Updating https://github.com/adafruit/Adafruit_CircuitPython_CharLCD to 2.4.1 from 2.4.0: > Merge pull request adafruit/Adafruit_CircuitPython_CharLCD#17 from adafruit/rgb_simpletest_pins Updating https://github.com/adafruit/Adafruit_CircuitPython_DRV2605 to 1.0.0 from 0.9.0: > Merge pull request adafruit/Adafruit_CircuitPython_DRV2605#11 from process1183/sequence_property > Merge pull request adafruit/Adafruit_CircuitPython_DRV2605#10 from process1183/asserts > ignore the board module imports in .pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_DS1307 to 1.3.1 from 1.3.0: > ignore the board module imports in .pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_DS18X20 to 1.1.2 from 1.1.1: > Merge pull request adafruit/Adafruit_CircuitPython_DS18X20#8 from adafruit/setup-py-fix Updating https://github.com/adafruit/Adafruit_CircuitPython_DS2413 to 1.1.1 from 1.1.0: > ignore the board module imports in .pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_DS3231 to 2.1.1 from 2.1.0: > Merge pull request adafruit/Adafruit_CircuitPython_DS3231#10 from process1183/blinka > ignore the board module imports in .pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_EPD to 1.2.0 from 1.1.0: > Merge pull request adafruit/Adafruit_CircuitPython_EPD#4 from adafruit/tannewt-patch-1 > ignore the board module imports in .pylintrc > DM: slight example fix > dearest pylint > DM: to my friend pylint > DM: fix pylint stuff > DM: working blinka example > DM: adding blinka support Updating https://github.com/adafruit/Adafruit_CircuitPython_Fingerp to 1.1.2 from 1.1.1: > ignore the board module imports in .pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_FocalTouch to 1.1.1 from 1.1.0: > ignore the board module imports in .pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_FXAS21002C to 1.2.1 from 1.2.0: > ignore the board module imports in .pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_FXOS8700 to 1.2.1 from 1.2.0: > ignore the board module imports in .pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_GPS to 3.2.0 from 3.1.1: > Merge pull request adafruit/Adafruit_CircuitPython_GPS#13 from kattni/example-name-change > Merge pull request adafruit/Adafruit_CircuitPython_GPS#11 from process1183/blinka > Merge pull request adafruit/Adafruit_CircuitPython_GPS#9 from arofarn/master > ignore the board module imports in .pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_INA219 to 3.1.1 from 3.1.0: > ignore the board module imports in .pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_IS31FL3731 to 2.2.1 from 2.2.0: > ignore the board module imports in .pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_LSM303 to 1.2.2 from 1.2.1: > Merge pull request adafruit/Adafruit_CircuitPython_LSM303#9 from adafruit/microbuilder-patch-1 Updating https://github.com/adafruit/Adafruit_CircuitPython_MatrixKe to 1.1.3 from 1.1.2: > Rename file > Merge pull request adafruit/Adafruit_CircuitPython_MatrixKe#5 from adafruit/rpi_simpletests Updating https://github.com/adafruit/Adafruit_CircuitPython_MAX31855 to 3.0.4 from 3.0.3: > Merge pull request adafruit/Adafruit_CircuitPython_MAX31855#8 from sommersoft/pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_MAX31865 to 2.1.1 from 2.1.0: > ignore the board module imports in .pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_MAX9744 to 1.1.1 from 1.1.0: > ignore the board module imports in .pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_MCP4725 to 1.1.1 from 1.1.0: > ignore the board module imports in .pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_MCP9808 to 3.2.1 from 3.2.0: > ignore the board module imports in .pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_MLX90393 to 1.1.2 from 1.1.1: > Merge pull request adafruit/Adafruit_CircuitPython_MLX90393#3 from adafruit/setup-py-update Updating https://github.com/adafruit/Adafruit_CircuitPython_MMA8451 to 1.2.1 from 1.2.0: > ignore the board module imports in .pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_MPL115A2 to 1.0.1 from 1.0.0: > Merge pull request adafruit/Adafruit_CircuitPython_MPL115A2#2 from kattni/pypi > Removing initial readme. Updating https://github.com/adafruit/Adafruit_CircuitPython_MPL3115A2 to 1.1.1 from 1.1.0: > ignore the board module imports in .pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_MPR121 to 1.2.1 from 1.2.0: > Merge pull request adafruit/Adafruit_CircuitPython_MPR121#13 from caternuson/iss11 > Merge pull request adafruit/Adafruit_CircuitPython_MPR121#10 from caternuson/example_update Updating https://github.com/adafruit/Adafruit_CircuitPython_NeoTre to 1.0.3 from 1.0.2: > Merge pull request adafruit/Adafruit_CircuitPython_NeoTre#3 from adafruit/build-badge-update Updating https://github.com/adafruit/Adafruit_CircuitPython_PCA9685 to 3.2.3 from 3.2.2: > ignore the board module imports in .pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_PCF8523 to 1.2.1 from 1.2.0: > ignore the board module imports in .pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_Pixie to 1.1.1 from 1.1.0: > ignore the board module imports in .pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_RFM69 to 1.2.1 from 1.2.0: > ignore the board module imports in .pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_RGB_Display to 3.1.1 from 3.1.0: > ignore the board module imports in .pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_SGP30 to 2.0.0 from 1.1.0: > Merge pull request adafruit/Adafruit_CircuitPython_SGP30#12 from adafruit/pypi-readme-update > Merge pull request adafruit/Adafruit_CircuitPython_SGP30#11 from process1183/typos > Merge pull request adafruit/Adafruit_CircuitPython_SGP30#10 from process1183/standardize > Merge pull request adafruit/Adafruit_CircuitPython_SGP30#9 from brentru/patch-1 > ignore the board module imports in .pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_SH to 2.0.1 from 2.0.0: > ignore the board module imports in .pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_SI4713 to 1.1.1 from 1.1.0: > ignore the board module imports in .pylintrc > Merge pull request adafruit/Adafruit_CircuitPython_SI4713#5 from adafruit/raspi_fixen Updating https://github.com/adafruit/Adafruit_CircuitPython_SI5351 to 1.1.1 from 1.1.0: > ignore the board module imports in .pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_SI7021 to 3.1.1 from 3.1.0: > ignore the board module imports in .pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_SSD1306 to 2.4.1 from 2.4.0: > ignore the board module imports in .pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_STMPE610 to 1.1.1 from 1.1.0: > ignore the board module imports in .pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_TLC5947 to 1.1.1 from 1.1.0: > ignore the board module imports in .pylintrc > Merge pull request adafruit/Adafruit_CircuitPython_TLC5947#5 from adafruit/loop_simpletest > Merge pull request adafruit/Adafruit_CircuitPython_TLC5947#4 from adafruit/led_up_down_example Updating https://github.com/adafruit/Adafruit_CircuitPython_TLC59711 to 1.1.1 from 1.1.0: > ignore the board module imports in .pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_TMP007 to 1.0.1 from 1.0.0: > ignore the board module imports in .pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_Trellis to 1.2.0 from 1.1.0: > Merge pull request adafruit/Adafruit_CircuitPython_Trellis#9 from adafruit/cpython_mask > ignore the board module imports in .pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_TrellisM4 to 1.2.1 from 1.2.0: > Merge pull request adafruit/Adafruit_CircuitPython_TrellisM4#13 from kattni/example-rename > Merge pull request adafruit/Adafruit_CircuitPython_TrellisM4#12 from kattni/neopixel-demo-code Updating https://github.com/adafruit/Adafruit_CircuitPython_TSL2561 to 3.1.2 from 3.1.1: > ignore the board module imports in .pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_TSL2591 to 1.1.1 from 1.1.0: > ignore the board module imports in .pylintrc > Merge pull request adafruit/Adafruit_CircuitPython_TSL2591#6 from Rvice/master Updating https://github.com/adafruit/Adafruit_CircuitPython_VCNL4010 to 0.9.1 from 0.9.0: > ignore the board module imports in .pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_VEML6070 to 2.0.0 from 1.1.0: > Merge pull request adafruit/Adafruit_CircuitPython_VEML6070#5 from sommersoft/prop_set > ignore the board module imports in .pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_VL53L0X to 3.1.4 from 3.1.3: > ignore the board module imports in .pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_VL6180X to 1.1.1 from 1.1.0: > ignore the board module imports in .pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_WS2801 to 0.9.1 from 0.9.0: > ignore the board module imports in .pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_AVRprog to 1.1.1 from 1.1.0: > ignore the board module imports in .pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_FancyLED to 1.2.1 from 1.2.0: > ignore the board module imports in .pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_FeatherWing to 0.9.3 from 0.9.2: > Merge pull request adafruit/Adafruit_CircuitPython_FeatherWing#16 from process1183/blinka > ignore the board module imports in .pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_LED_Animation to 0.8.1 from 0.8.0: > Merge pull request adafruit/Adafruit_CircuitPython_LED_Animation#1 from siddacious/master > fixes rtd badge url. Updating https://github.com/adafruit/Adafruit_CircuitPython_OneWire to 1.1.1 from 1.1.0: > Merge pull request adafruit/Adafruit_CircuitPython_OneWire#9 from caternuson/iss7_max_device > ignore the board module imports in .pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_Register to 1.3.2 from 1.3.1: > ignore the board module imports in .pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_Waveform to 1.2.1 from 1.2.0: > ignore the board module imports in .pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA: > Added the following libraries: Adafruit_CircuitPython_DS18X20, Adafruit_CircuitPython_MLX90393, Adafruit_CircuitPython_MPL115A2
Fixed issues relating to overflow (negative lux values) that were leading to adjustment loops. I think the initial measurement after increasing gain would, for some reason, always overflow. Also, modified the TSL2591 library from Adafruit based on this change to the CircuitPython version adafruit/Adafruit_CircuitPython_TSL2591#6
Issue #5 fix by adding the maxCount and using a >= instead of just == check.
See Control Register (0x01) MaxCount for ATime of 100 ms to see the max count from the sensor is 36863