Skip to content

Commit 4e9f72b

Browse files
committed
set max bandwidth for Firmata sketch and bleuart sketch
1 parent e3a1b89 commit 4e9f72b

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

libraries/Bluefruit52Lib/examples/Peripheral/StandardFirmataBLE/StandardFirmataBLE.ino

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -781,14 +781,20 @@ void setup()
781781
Serial.begin(115200);
782782
Serial.println("Bluefruit52 Standard Firmata via BLEUART Example");
783783
Serial.println("------------------------------------------------\n");
784-
784+
785+
// Config the peripheral connection with maximum bandwidth
786+
// more SRAM required by SoftDevice
787+
Bluefruit.configPrphBandwidth(BANDWIDTH_MAX);
788+
785789
Bluefruit.begin();
786790
Bluefruit.setName("Bluefruit52");
791+
787792
// Set max power. Accepted values are: -40, -30, -20, -16, -12, -8, -4, 0, 4
788793
Bluefruit.setTxPower(4);
794+
789795
// try to go as fast as possible, could be rejected by some central, increase it if needed
790796
// iOS won't negotitate and will mostly use 30ms
791-
Bluefruit.setConnInterval(9, 16); // min = 9*1.25=11.25 ms, max = 16*1.25=20ms
797+
Bluefruit.setConnInterval(9, 24); // min = 9*1.25=11.25 ms, max = 23*1.25=30ms
792798

793799
// Configure and Start BLE Uart Service
794800
// Firmata use several small write(1) --> buffering TXD is required to run smoothly

libraries/Bluefruit52Lib/examples/Peripheral/bleuart/bleuart.ino

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ void setup()
3636
// here in case you want to control this LED manually via PIN 19
3737
Bluefruit.autoConnLed(true);
3838

39+
// Config the peripheral connection with maximum bandwidth
40+
// more SRAM required by SoftDevice
41+
Bluefruit.configPrphBandwidth(BANDWIDTH_MAX);
42+
3943
Bluefruit.begin();
4044
// Set max power. Accepted values are: -40, -30, -20, -16, -12, -8, -4, 0, 4
4145
Bluefruit.setTxPower(4);

0 commit comments

Comments
 (0)