kopia lustrzana https://github.com/pimoroni/pimoroni-pico
Fix for i2c select
rodzic
f2ee2a4f8d
commit
1ee5101826
|
@ -62,7 +62,7 @@ mp_obj_t BreakoutAS7262_make_new(const mp_obj_type_t *type, size_t n_args, size_
|
|||
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);
|
||||
|
|
|
@ -65,7 +65,7 @@ mp_obj_t BreakoutDotMatrix_make_new(const mp_obj_type_t *type, size_t n_args, si
|
|||
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);
|
||||
|
|
|
@ -69,7 +69,7 @@ mp_obj_t BreakoutEncoder_make_new(const mp_obj_type_t *type, size_t n_args, size
|
|||
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);
|
||||
|
|
|
@ -69,7 +69,7 @@ mp_obj_t BreakoutIOExpander_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);
|
||||
|
|
|
@ -69,7 +69,7 @@ mp_obj_t BreakoutLTR559_make_new(const mp_obj_type_t *type, size_t n_args, size_
|
|||
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);
|
||||
|
|
|
@ -69,7 +69,7 @@ mp_obj_t BreakoutMICS6814_make_new(const mp_obj_type_t *type, size_t n_args, siz
|
|||
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);
|
||||
|
|
|
@ -62,7 +62,7 @@ mp_obj_t BreakoutMSA301_make_new(const mp_obj_type_t *type, size_t n_args, size_
|
|||
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);
|
||||
|
|
|
@ -69,7 +69,7 @@ mp_obj_t BreakoutPotentiometer_make_new(const mp_obj_type_t *type, size_t n_args
|
|||
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);
|
||||
|
|
|
@ -65,7 +65,7 @@ mp_obj_t BreakoutRGBMatrix5x5_make_new(const mp_obj_type_t *type, size_t n_args,
|
|||
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);
|
||||
|
|
|
@ -65,7 +65,7 @@ mp_obj_t BreakoutRTC_make_new(const mp_obj_type_t *type, size_t n_args, size_t n
|
|||
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);
|
||||
|
|
|
@ -58,7 +58,7 @@ mp_obj_t BreakoutSGP30_make_new(const mp_obj_type_t *type, size_t n_args, size_t
|
|||
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);
|
||||
|
|
|
@ -69,7 +69,7 @@ mp_obj_t BreakoutTrackball_make_new(const mp_obj_type_t *type, size_t n_args, si
|
|||
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