Arduino nano BLE auto connect features peripheral device is available in range.

I want to implement auto connect feature in arduino nano BLE. The central device should check whether the peripheral device within range or not. if it is within range it should connect the peripheral device then connect with the peripheral device.

How will I proceed?

Have a look at the examples for the Arduino Nano 33 BLE. When you have installed the ArduinoBLE library from the library manager go to

File -> Examples -> ArduinoBLE -> Central -> LedControl

It does exactly what you want to do. It works together with the following example

File -> Examples -> ArduinoBLE -> Peripheral -> ButtonLED

Klaus_K: Have a look at the examples for the Arduino Nano 33 BLE. When you have installed the ArduinoBLE library from the library manager go to

File -> Examples -> ArduinoBLE -> Central -> LedControl

It does exactly what you want to do. It works together with the following example

File -> Examples -> ArduinoBLE -> Peripheral -> ButtonLED

thanks i was looking for that too. using a unique custom uuid and then scanForUuid() or just scanForAddress() looks like a good solution if you ever want to connect to a one specific board. much better solution would be bonding/pairing option but it is not implemented yet. you can track it from here https://github.com/arduino-libraries/ArduinoBLE/issues/36