Merge pull request #555 from MichaelBell/fix-ltp305-brightness

Fix setting the LTP305 brightness
This commit is contained in:
Hel Gibbons 2022-11-08 11:26:45 +00:00 committed by GitHub
commit be1c39e80c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -27,8 +27,8 @@ namespace pimoroni {
return i2c->get_scl();
}
void LTP305::set_brightness(uint8_t brightness, bool update) {
brightness = std::min((uint8_t)MAX_BRIGHTNESS, brightness);
void LTP305::set_brightness(uint8_t brightness_, bool update) {
brightness = std::min((uint8_t)MAX_BRIGHTNESS, brightness_);
if(update)
i2c->reg_write_uint8(address, CMD_BRIGHTNESS, brightness);
}