Skip to content

Commit e5c8841

Browse files
committed
MCU8MASS-1786 Add pull-ups for SW0 and SW1 in all examples
1 parent 531f1a5 commit e5c8841

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

examples/gpio/gpio.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ void setup() {
3535

3636
// In order to configure a pin as an input, for example the button SW0 at
3737
// PD2, we can do the following:
38-
pinConfigure(PIN_PD2, PIN_DIR_INPUT);
38+
pinConfigure(PIN_PD2, PIN_DIR_INPUT | PIN_PULLUP_ON);
3939

4040
// Then we can e.g. attach an interrupt to the button when it is pressed (on
4141
// the falling edge). If we want to have an interrupt when the button is

examples/power_down/power_down.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ void setup() {
3232
LedCtrl.startupCycle();
3333

3434
// Attach interrupt callback to detect if SW0 was pressed during sleep
35-
pinConfigure(SW0, PIN_DIR_INPUT);
35+
pinConfigure(SW0, PIN_DIR_INPUT | PIN_PULLUP_ON);
3636
attachInterrupt(SW0, button_pressed_callback, FALLING);
3737

3838
// Now we configure the low power module for power down configuration, where

examples/power_save/power_save.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ void setup() {
3333
LedCtrl.startupCycle();
3434

3535
// Attach interrupt callback to detect if SW0 was pressed during sleep
36-
pinConfigure(SW0, PIN_DIR_INPUT);
36+
pinConfigure(SW0, PIN_DIR_INPUT | PIN_PULLUP_ON);
3737
attachInterrupt(SW0, button_pressed_callback, FALLING);
3838

3939
// Now we configure the power save configuration. Note that this has to be

examples/sandbox/sandbox.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ void setup() {
284284
LedCtrl.startupCycle();
285285

286286
// Set PD2 as input (button)
287-
pinConfigure(PIN_PD2, PIN_DIR_INPUT);
287+
pinConfigure(PIN_PD2, PIN_DIR_INPUT | PIN_PULLUP_ON);
288288
attachInterrupt(PIN_PD2, sendHeartbeatInterrupt, FALLING);
289289

290290
// Set PF6 as input (reset button)

0 commit comments

Comments
 (0)