Skip to content

Commit c4fe926

Browse files
committed
update beacon.ino to suspend loop()
1 parent e84fd54 commit c4fe926

File tree

1 file changed

+6
-4
lines changed
  • libraries/Bluefruit52Lib/examples/Peripheral/beacon

1 file changed

+6
-4
lines changed

libraries/Bluefruit52Lib/examples/Peripheral/beacon/beacon.ino

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ void setup()
4040

4141
Bluefruit.begin();
4242
// Set max power. Accepted values are: -40, -30, -20, -16, -12, -8, -4, 0, 4
43-
Bluefruit.setTxPower(4);
43+
Bluefruit.autoConnLed(false);
44+
Bluefruit.setTxPower(0);
4445
Bluefruit.setName("Bluefruit52");
4546

4647
// Manufacturer ID is required for Manufacturer Specific Data
@@ -50,6 +51,9 @@ void setup()
5051
startAdv();
5152

5253
Serial.println("Broadcasting beacon, open your beacon app to test");
54+
55+
// Suspend Loop() to save power, since we didn't have any code there
56+
suspendLoop();
5357
}
5458

5559
void startAdv(void)
@@ -81,8 +85,6 @@ void startAdv(void)
8185

8286
void loop()
8387
{
84-
// Toggle both LEDs every second
85-
digitalToggle(LED_RED);
86-
delay(1000);
88+
// loop is already suspended, CPU will not run loop() at all
8789
}
8890

0 commit comments

Comments
 (0)