Fix for i2c select

pull/155/head
ZodiusInfuser 2021-05-14 18:13:47 +01:00
rodzic 1ee5101826
commit 1508f650b9
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -65,7 +65,7 @@ mp_obj_t BreakoutMatrix11x7_make_new(const mp_obj_type_t *type, size_t n_args, s
int scl = args[ARG_scl].u_int;
if(i2c_id == -1) {
i2c_id = sda & 1;
i2c_id = (sda >> 1) & 0b1; // If no i2c specified, choose the one for the given SDA pin
}
if(i2c_id < 0 || i2c_id > 1) {
mp_raise_msg_varg(&mp_type_ValueError, MP_ERROR_TEXT("I2C(%d) doesn't exist"), i2c_id);