Skip to content

Commit

Permalink
Merge pull request #19 from Hynek-Texl/master
Browse files Browse the repository at this point in the history
LTR553 bug fixes
  • Loading branch information
lewisxhe authored Jan 21, 2025
2 parents de9a1d2 + 9f7d9ed commit 6183869
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/SensorLTR553.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ class SensorLTR553 :

void setLightSensorGain(LightSensorGain gain)
{
writeRegister(LTR553_REG_ALS_CONTR, 0xE3, gain);
writeRegister(LTR553_REG_ALS_CONTR, 0xE3, gain<<2);
}

int getLightSensor(uint8_t ch)
Expand Down Expand Up @@ -275,7 +275,8 @@ class SensorLTR553 :
if (saturated) {
*saturated = buffer[1] & 0x80;
}
return buffer[0] | (buffer[1] & 0x03);
int high = buffer[1] & 0x07;
return (high << 8) | buffer[0];
}

void setPsLedPulsePeriod(PsLedPeriod period)
Expand Down

0 comments on commit 6183869

Please sign in to comment.