kopia lustrzana https://github.com/pimoroni/pimoroni-pico
Fix for set brightness not working
rodzic
42f2bff6c7
commit
4a206a9b70
|
@ -165,7 +165,7 @@ mp_obj_t BreakoutEncoder_set_brightness(size_t n_args, const mp_obj_t *pos_args,
|
|||
if(brightness < 0 || brightness > 1.0f)
|
||||
mp_raise_ValueError("brightness out of range. Expected 0.0 to 1.0");
|
||||
else
|
||||
self->breakout->set_brightness((uint8_t)(brightness * 255.0f));
|
||||
self->breakout->set_brightness(brightness);
|
||||
|
||||
return mp_const_none;
|
||||
}
|
||||
|
|
|
@ -166,7 +166,7 @@ mp_obj_t BreakoutMICS6814_set_brightness(size_t n_args, const mp_obj_t *pos_args
|
|||
if(brightness < 0 || brightness > 1.0f)
|
||||
mp_raise_ValueError("brightness out of range. Expected 0.0 to 1.0");
|
||||
else
|
||||
self->breakout->set_brightness((uint8_t)(brightness * 255.0f));
|
||||
self->breakout->set_brightness(brightness);
|
||||
|
||||
return mp_const_none;
|
||||
}
|
||||
|
|
|
@ -188,7 +188,7 @@ mp_obj_t BreakoutPotentiometer_set_brightness(size_t n_args, const mp_obj_t *pos
|
|||
if(brightness < 0 || brightness > 1.0f)
|
||||
mp_raise_ValueError("brightness out of range. Expected 0.0 to 1.0");
|
||||
else
|
||||
self->breakout->set_brightness((uint8_t)(brightness * 255.0f));
|
||||
self->breakout->set_brightness(brightness);
|
||||
|
||||
return mp_const_none;
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue