kopia lustrzana https://github.com/pimoroni/pimoroni-pico
Fix for i2c select
rodzic
1ee5101826
commit
1508f650b9
|
@ -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);
|
||||
|
|
Ładowanie…
Reference in New Issue