Arduino Function: BLECentralRole.setScanInterval




Set the time inside the scan window during the which the board will scan.




  • interval: short.  Scan interval. This value is expressed in 0.625 ms increments and must be between  0x0004 (2.5 ms) and 0x4000 (10.24 s).





 Written by Chiara Ruggeri (
 This example for the Arduino Primo board implements the Observer role of the BLE protocol.
 Once scan parameters are set, the sketch continuously listen for advertising packets.

 This example code is in the public domain.

#include "BLECentralRole.h"

// download ArduinoLowPower library from library manager to enter in low power mode
#include "ArduinoLowPower.h"

// create central instance
BLECentralRole bleCentral = BLECentralRole();

void setup() {

 // assign event handler for scanReceived event
 bleCentral.setEventHandler(BLEScanReceived, receiveAdvPck);

 // set scan parameters
 // interval and window in 0.625 ms increments
 bleCentral.setScanInterval(3200); // 2 sec
 bleCentral.setScanWindow(800);  // 0.5 sec

 // timeout in seconds. 0 disables timeout

 // active scan true to ask for scan response packet

 // begin initialization and start scanning

void loop() {

 // since we want to realize a low power application we don't handle the
 // BLE_LED in order to save power but put the board in low power mode instead.

void receiveAdvPck(BLEPeripheralPeer& peer){
 // print the advertising packet received

Written by