Skip to content

Commit d76cbf9

Browse files
authored
Fix, now it can be set up the buttons sens
Fixed buttons' custom sensivity change inside begin()
1 parent 48702b8 commit d76cbf9

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

src/Arduino_MKRIoTCarrier.cpp

+14-10
Original file line numberDiff line numberDiff line change
@@ -33,29 +33,33 @@ int MKRIoTCarrier::begin(){
3333
display.init(240, 240); // Initialize ST7789 screen
3434
pinMode(3,INPUT_PULLUP); // RESET fix
3535

36-
//Default rotation to align it with the carrier
36+
//Default rotation to align it with the carrier
3737
display.setRotation(2);
38-
display.fillScreen(ST77XX_BLACK);
38+
display.fillScreen(ST77XX_BLACK);
3939

40-
if(CARRIER_CASE){
41-
TOUCH.setSensorsSensitivity(4u);
42-
}else{
43-
TOUCH.setSensorsSensitivity(100u);
40+
41+
if(!Buttons.customSens){
42+
43+
if(CARRIER_CASE){
44+
TOUCH.setSensorsSensitivity(4u);
45+
}else{
46+
TOUCH.setSensorsSensitivity(100u);
47+
}
48+
Buttons.begin(); //init buttons
4449
}
45-
Buttons.begin(); //init buttons
4650

4751
//init LEDs
4852
leds.begin();
49-
leds.clear();
50-
leds.show();
53+
leds.clear();
54+
leds.show();
5155

5256
//PMIC init
5357
PMIC.begin();
5458
PMIC.enableBoostMode();
5559

5660
//Sensors
5761
uint8_t sensorsOK = !Light.begin() << 0 | !Pressure.begin() << 1 | !IMUmodule.begin() << 2 | !Env.begin() << 3 ;
58-
// Serial.println(sensorsOK , BIN);
62+
//Serial.println(sensorsOK , BIN);
5963

6064
//If some of the sensors are not connected
6165
if(sensorsOK > 0 ){

0 commit comments

Comments
 (0)