kopia lustrzana https://github.com/pimoroni/pimoroni-pico
Merge pull request #555 from MichaelBell/fix-ltp305-brightness
Fix setting the LTP305 brightnesspull/565/head
commit
be1c39e80c
|
@ -27,8 +27,8 @@ namespace pimoroni {
|
||||||
return i2c->get_scl();
|
return i2c->get_scl();
|
||||||
}
|
}
|
||||||
|
|
||||||
void LTP305::set_brightness(uint8_t brightness, bool update) {
|
void LTP305::set_brightness(uint8_t brightness_, bool update) {
|
||||||
brightness = std::min((uint8_t)MAX_BRIGHTNESS, brightness);
|
brightness = std::min((uint8_t)MAX_BRIGHTNESS, brightness_);
|
||||||
if(update)
|
if(update)
|
||||||
i2c->reg_write_uint8(address, CMD_BRIGHTNESS, brightness);
|
i2c->reg_write_uint8(address, CMD_BRIGHTNESS, brightness);
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue