Fix for set brightness not working

pull/144/head
ZodiusInfuser 2021-05-12 17:51:54 +01:00 zatwierdzone przez Phil Howard
rodzic 42f2bff6c7
commit 4a206a9b70
3 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -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;
}

Wyświetl plik

@ -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;
}

Wyświetl plik

@ -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;
}