I just got my ble sense, I tried connecting it to the pc via a classic bluetooth, then learned later, ble doesn't support the classic devices, and I am not sure about how to connect the ble sense to my pc.
I want to take the accelerometer readings while running, so in a need to connect it to the pc. Does any one know how to connect it to a pc via ble.
I learned that I should include ble.h files, to call the adruino but how do I upload it to the ble sense arduino? without a usb cable?
It would be really great if someone could help me. Thank you.
Bluetooth Classic and Bluetooth LE are two different things. They are not compatible.
First you need to find out whether your PC supports BLE.
In BLE you do not need to pair. Pairing is an optional security feature currently not supported by the Arduino BLE library. This is usually done trough the OS.
You should be able to connect to your BLE device from your application. BLE has been designed to connect, get the data and disconnect to allow very low power applications.
I do not think there is a update over the air support available.
What application do you want to use to connect to your Arduino over BLE?
Install the Arduino BLE library for the Arduino Nano 33 BLE using the Tools -> Manage Libraries
Look at the examples. File -> Examples -> ArduinoBLE
There are two categories
Central
Peripheral
Start with the Peripheral and load the LED example. Get an application for your smartphone that supports BLE. I use BLE Scanner 4.0 on the iPhone (its free and from Bluepixel Technologies). Connect to your Arduino LED and look at your source code and the data the app provides.
The sketch does the following, its creates a structure called GATT which holds the data and then starts advertising. Anyone can detect these advertisements, connect to the Arduino and read the GATT. The Arduino code decides which data has read or write access.
If you like an example for other types of data e.g. accelerometer have a look at the following post. In post #11 you can find a test sketch I have written that also includes this.
Regarding the application. If you want to read the data that the Arduino provides using the GATT you will need a program that connects to the Arduino and reads the data, just like the app on the smartphone.
If you have two Arduino Nano 33 BLE you can use the LEDControl example from the Central subfolder. The Central device is doing exactly the same thing as the smartphone app.
During development the software can only be programmed into the Arduino Nano BLE Sense via the USB cable. There is no update over the air support (OTA) in the bootloader.
For your application you can read and write data from any platform that supports BLE.
I tested the sketch with my phone and could see the data updating live.
If you want to use a program on a PC you will need to look for one that does not require pairing. I tested the Microsoft Bluetooth Explorer. I could see the Arduino but the program requires pairing for data display and that does not work.