Evening, Steve!
stevestrong wrote: Wed Jun 24, 2020 6:29 pm
Winnie_The_Pooh wrote: Wed Jun 24, 2020 3:58 pm
Tried the only EML6075 on second I2C bus. Still zero.
If the address is recognized but the value read is 0 this can mean:
- your read routine is wrong
Possible in principle.
I copied the reading routine from lib to separate pin. It is very simple and usual and absolutely the same is used to read both MAX44009 and EML6075. Code was posted a little bit earlier here.
This code being used in the Official STM32 Core works OK. Works OK - mean values from EML6075 are adequate to UV light.
This code with SoftWire also works OK, when I replace all reference from Wire.smth to SWire.smth
My formal logic says, that reason is EML6075 + the Roger Clark incarnation hardWire.
Using formal logic:
EML6075 software + the Official STM32 Core = OK
MAX44009 software + the Official STM32 Core = OK
EML6075 software + the Roger Clark incarnation HARDWIRE = OK
MAX44009 software + the Roger Clark incarnation HARDWIRE = BAD
EML6075 software + the Roger Clark incarnation SOFTWIRE = OK
MAX44009 software + the Roger Clark incarnation SOFTWIRE = OK
BTW, I tried to use code for MAX44009 to read data from EML6075 - in fact it demands only to use another address of sensor and another register number to read. Result is absolutely the same = zeroes.
stevestrong wrote: Wed Jun 24, 2020 6:29 pm
- value 0 is valid.
No. When EML6075 reads OK - values correlates to UV light intensity.
Also device ID can be readed:
11:59:13.625 -> Reading EML6075...
11:59:13.625 -> 6075 device ID: 26
11:59:13.625 -> raw_uva: 326
11:59:13.625 -> raw_uvb: 346
11:59:13.625 -> raw_dark: 17
11:59:13.625 -> raw_vis: 9F
11:59:13.625 -> raw_ir: 5B
11:59:13.625 -> UVA: 390.64
11:59:13.625 -> UVB: 295.48
11:59:13.625 -> UVI: 0.67
11:59:13.625 -> Lux: 7050.24
11:59:13.625 ->
stevestrong wrote: Wed Jun 24, 2020 6:29 pm
Btw, I cannot see where you tell the EML6075 lib that it should use I2C 2.
Just because you begin I2C2 in setup it does not mean that all libraries will use I2C 2.
As I said earlier - I do not use libs. I cut the code from libs and use it directly in code. The Wire object is common for all programm.
The program posted earlier here.