You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: libraries/Bluefruit52Lib/examples/Projects/rssi_proximity/rssi_proximity_central/rssi_proximity_central.ino
+66-47Lines changed: 66 additions & 47 deletions
Original file line number
Diff line number
Diff line change
@@ -59,7 +59,7 @@
59
59
60
60
#defineVERBOSE_OUTPUT (0) // Set this to 1 for verbose adv packet output to the serial monitor
61
61
#defineENABLE_TFT (0) // Set this to 1 to enable ILI9341 TFT display support
62
-
#defineARRAY_SIZE (6) // The number of RSSI values to store and compare
62
+
#defineARRAY_SIZE (4) // The number of RSSI values to store and compare
63
63
#defineTIMEOUT_MS (2500) // Number of milliseconds before a record is invalidated in the list
64
64
65
65
#if (ARRAY_SIZE <= 0)
@@ -132,12 +132,6 @@ void setup()
132
132
// since 0 would be higher than any valid RSSI value
133
133
records[i].rssi = -128;
134
134
}
135
-
records[2].rssi = -45;
136
-
records[2].timestamp = millis();
137
-
records[1].rssi = -65;
138
-
records[1].timestamp = millis();
139
-
bubbleSort();
140
-
printRecordList();
141
135
142
136
/* Enable both peripheral and central modes */
143
137
err_t err = Bluefruit.begin(true, true);
@@ -175,7 +169,7 @@ void setup()
175
169
Bluefruit.Scanner.setRxCallback(scan_callback);
176
170
Bluefruit.Scanner.restartOnDisconnect(true);
177
171
Bluefruit.Scanner.filterRssi(-80); // Only invoke callback for devices with RSSI >= -80 dBm
178
-
//Bluefruit.Scanner.filterUuid(uuid); // Only invoke callback if the target UUID was found
172
+
Bluefruit.Scanner.filterUuid(uuid); // Only invoke callback if the target UUID was found
179
173
//Bluefruit.Scanner.filterMSD(0xFFFF); // Only invoke callback when MSD is present with the specified Company ID
180
174
Bluefruit.Scanner.setInterval(160, 80); // in units of 0.625 ms
181
175
Bluefruit.Scanner.useActiveScan(true); // Request scan response data
0 commit comments