Step 4: Make the build your own

Step 4: Make the build your own

animation
bluetooth
ble

Step 4: Make the build your own

After the scanner, temperature service, and beacon all work, the next useful move is practice. These challenges keep the same code path but ask you to change one design decision at a time.

Modify the scanner to only display devices with RSSI stronger than -80 dBm.

Hint: Add an if statement in onResult():

if (rssi < -80) return;  // Skip weak signals

Track how many devices are in each proximity zone and display a summary after each scan. Add counter variables and increment them in onResult().

Create an array of “known” device addresses and highlight them differently.

Hint:

String knownDevices[] = {"a4:c1:38:12:34:56", "b8:27:eb:aa:bb:cc"};
// Check if address matches known devices

Modify the scanner to specifically detect and parse iBeacon packets. Check manufacturer data for Apple’s company ID (0x004C).

Checkpoint: you should now be able to point to the exact line you changed, describe the BLE behavior it affects, and predict what should appear differently in the Serial Monitor or phone scanner.

Back to the chapter