Working on a driver for the Maxim MAX44009 Ambient Light Sensor - used on the GY-49 module:
https://github.com/mcauser/micropython-max44009
MAX44009 Ambient Light Sensor
- rcolistete
- Posts: 352
- Joined: Thu Dec 31, 2015 3:12 pm
- Location: Brazil
- Contact:
Re: MAX44009 Ambient Light Sensor
MAX44009 is an excellent light sensor, very low power, good range, etc.
Here is another MicroPython driver, I've developed with 4 versions : normal, low memory usage, BBC Micro:bit, BBC Micro:bit with low memory usage :
https://github.com/rcolistete/MicroPyth ... 009_driver
Here is another MicroPython driver, I've developed with 4 versions : normal, low memory usage, BBC Micro:bit, BBC Micro:bit with low memory usage :
https://github.com/rcolistete/MicroPyth ... 009_driver
My "MicroPython Samples". My "MicroPython Firmwares" with many options (double precision, ulab, etc).
Re: MAX44009 Ambient Light Sensor
Nice work!
On my GY-49, I was unable to read 2 bytes starting from the lux high byte.
Mine was not auto moving to the next register (lux low byte).
When I readfrom_mem() multiple times on any register, it would just give me the same value repeated again and again.
I couldn't just read the high byte then read the low byte in separate transfers, as the values may belong to different sensor reads.
a START condition pauses the sensor updating the registers and a STOP resumes, so there's a tiny gap between the two transfers.
That's why I had to manually simulate a readfrom_mem(addr, reg, 2) by using multiple writeto() + readfrom_into() as a repeated start transfer.
Could I perhaps I have a clone MAX44009? Or maybe there is a register I can fiddle with to allow reading sequential registers?
On my GY-49, I was unable to read 2 bytes starting from the lux high byte.
Mine was not auto moving to the next register (lux low byte).
When I readfrom_mem() multiple times on any register, it would just give me the same value repeated again and again.
I couldn't just read the high byte then read the low byte in separate transfers, as the values may belong to different sensor reads.
a START condition pauses the sensor updating the registers and a STOP resumes, so there's a tiny gap between the two transfers.
That's why I had to manually simulate a readfrom_mem(addr, reg, 2) by using multiple writeto() + readfrom_into() as a repeated start transfer.
Could I perhaps I have a clone MAX44009? Or maybe there is a register I can fiddle with to allow reading sequential registers?
- rcolistete
- Posts: 352
- Joined: Thu Dec 31, 2015 3:12 pm
- Location: Brazil
- Contact:
Re: MAX44009 Ambient Light Sensor
Have you tested using which MicroPython board ? With hard or soft I2C ?
My "MicroPython Samples". My "MicroPython Firmwares" with many options (double precision, ulab, etc).