How To Use The ArduinoBLE Library

I have installed the Arduino IDE version 2.3.4.

I have installed the ArduinoBLE library.

My project contains -

The Board is selected as Arduino Nano. (There is no Nano BLE listed)

#include <ArduinoBLE.h>

In Setup -

`digitalWrite(LED_PWR,LOW);` // Power LED Off (from a forum example)

`digitalWrite(LED_BUILTIN,LOW);`

I get the error - "Compilation error: 'LED_PWR' was not declared in this scope"

Is LED_PWR not declared in the library and I have to declare it?

I declared it as int LED_PWR; but I don't know what value to assign to it.

The LED.ino example uses const int ledPin = LED_BUILTIN; which seems to indicate that the variable LED_BUILTIN is already known without it having to be declared.

Then with the digitalWrites removed I get -

C:\Users\w\Documents\Arduino\libraries\ArduinoBLE\src\utility\HCIUartTransport.cpp:39:2: error: #error "Unsupported board selected!"
#error "Unsupported board selected!"
^~~~~
C:\Users\w\Documents\Arduino\libraries\ArduinoBLE\src\utility\HCIUartTransport.cpp:105:40: error: 'SerialHCI' was not declared in this scope
HCIUartTransportClass HCIUartTransport(SerialHCI, 912600);
^~~~~~~~~
C:\Users\w\Documents\Arduino\libraries\ArduinoBLE\src\utility\HCIUartTransport.cpp:105:40: note: suggested alternative: 'Serial'
HCIUartTransportClass HCIUartTransport(SerialHCI, 912600);
^~~~~~~~~
Serial

It seems like there is a problem with the ArduinoBLE library.

Thanks for any help you can give me.

The Board is selected as Arduino Nano. (There is no Nano BLE listed)

What exact board are you trying to use, and can you provide a link to where you purchased it?

Thanks for your reply.

I will be using -

The board I received is a genuine Arduino product.

The device is not connected.

The problem is that I have a sketch written for a Nano that compiles with the board set to Nano.

I added the include for the BLE library and the digitalWrite(LED_PWR,LOW); and it won’t compile.

I want to use the Nano BLE as a low power consumption device and instead of disconnecting the power LED I discovered the code to switch the LED off.

There is a board package for that board which you will have to add through the Board Manager of the IDE.

Tools>Board>BoardManager

And then select Arduino Mbed OS Nano Boards.

That will allow you to select the Arduino Nano 33 Ble as the board for your sketch.

That fixed it and taught me a lot.

Thanks very much for your help.