kriswiner / CMWX1ZZABZ

Collection of sketches using the Arduino core for Murata's CMWX1ZZABZ (STM32L082 and SX1276)
96 stars 30 forks source link

Cicada/LoraTile: Light values only update at beginning of sketch #13

Open everhamme opened 5 years ago

everhamme commented 5 years ago

I am trying to understand why the light values only update once at the beginning of the sketch. For subsequent updates all light values are reported as zero.

Beginning: Red raw counts = 212 Green raw counts = 173 Blue raw counts = 93 White raw counts = 498 Inferred IR raw counts = 20

Red light power density = 2.21 microWatt/cm^2 Green light power density = 2.34 microWatt/cm^2 Blue light power density = 1.66 microWatt/cm^2

Ambient light intensity = 43.54 lux

Correlated Color Temperature = 6819.09 Kelvin

During subsequent updates

Red raw counts = 0 Green raw counts = 0 Blue raw counts = 0 White raw counts = 0 Inferred IR raw counts = 0

Red light power density = 0.00 microWatt/cm^2 Green light power density = 0.00 microWatt/cm^2 Blue light power density = 0.00 microWatt/cm^2

Ambient light intensity = 0.00 lux

Correlated Color Temperature = nan Kelvin

kriswiner commented 5 years ago

Sometimes the device needs a bit more time to get the data. You could try adding 5 ms like this:

// VEML6040 Data VEML6040.enableVEML6040(IT); // enable VEML6040 sensor delay(ITime + 5); // wait for integration of light sensor data VEML6040.getRGBWdata(RGBWData); // read light sensor data VEML6040.disableVEML6040(IT); // disable VEML6040 sensor

On Thu, Jan 17, 2019 at 7:25 AM Ed Verhamme notifications@github.com wrote:

I am trying to understand why the light values only update once at the beginning of the sketch. For subsequent updates all light values are reported as zero.

Beginning: Red raw counts = 212 Green raw counts = 173 Blue raw counts = 93 White raw counts = 498 Inferred IR raw counts = 20

Red light power density = 2.21 microWatt/cm^2 Green light power density = 2.34 microWatt/cm^2 Blue light power density = 1.66 microWatt/cm^2

Ambient light intensity = 43.54 lux

Correlated Color Temperature = 6819.09 Kelvin

During subsequent updates

Red raw counts = 0 Green raw counts = 0 Blue raw counts = 0 White raw counts = 0 Inferred IR raw counts = 0

Red light power density = 0.00 microWatt/cm^2 Green light power density = 0.00 microWatt/cm^2 Blue light power density = 0.00 microWatt/cm^2

Ambient light intensity = 0.00 lux

Correlated Color Temperature = nan Kelvin

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kriswiner/CMWX1ZZABZ/issues/13, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qrXaJdgFfZJk50LQJZQGhx8FmtDvks5vEJX4gaJpZM4aF1-R .