@@ -60,7 +60,7 @@ If you use a local IDE you can copy & paste the following sketch:
60
60
61
61
Hardware required: https://store.arduino.cc/nicla-sense-me
62
62
63
- 1) Upload this sketch to the Arduino Nano BLE sense board
63
+ 1) Upload this sketch to the Arduino Nano Bluetooth® Low Energy sense board
64
64
65
65
2) Open the following web page in the Chrome browser:
66
66
https://arduino.github.io/ArduinoAI/NiclaSenseME-dashboard/
@@ -79,7 +79,7 @@ If you use a local IDE you can copy & paste the following sketch:
79
79
#include "Arduino_BHY2.h"
80
80
#include <ArduinoBLE.h>
81
81
82
- #define BLE_SENSE_UUID(val) ("19b10000" val "-537e-4f6c-d104768a1214")
82
+ #define BLE_SENSE_UUID(val) ("19b10000- " val "-537e-4f6c-d104768a1214")
83
83
84
84
const int VERSION = 0x00000000;
85
85
@@ -91,7 +91,7 @@ If you use a local IDE you can copy & paste the following sketch:
91
91
BLEFloatCharacteristic pressureCharacteristic(BLE_SENSE_UUID("4001"), BLERead);
92
92
93
93
BLECharacteristic accelerometerCharacteristic(BLE_SENSE_UUID("5001"), BLERead | BLENotify, 3 * sizeof(float)); // Array of 3x 2 Bytes, XY
94
- BLECharacteristic gyroscopeCharacteristic(BLE_SENSE_UUID("6001"), BLERead | BLENotify, 3 * sizeof(int16_t )); // Array of 3x 2 Bytes, XYZ
94
+ BLECharacteristic gyroscopeCharacteristic(BLE_SENSE_UUID("6001"), BLERead | BLENotify, 3 * sizeof(float )); // Array of 3x 2 Bytes, XYZ
95
95
BLECharacteristic quaternionCharacteristic(BLE_SENSE_UUID("7001"), BLERead | BLENotify, 4 * sizeof(float)); // Array of 4x 2 Bytes, XYZW
96
96
97
97
BLECharacteristic rgbLedCharacteristic(BLE_SENSE_UUID("8001"), BLERead | BLEWrite, 3 * sizeof(byte)); // Array of 3 bytes, RGB
@@ -122,7 +122,7 @@ If you use a local IDE you can copy & paste the following sketch:
122
122
nicla::leds.setColor(green);
123
123
124
124
//Sensors initialization
125
- BHY2.begin();
125
+ BHY2.begin(NICLA_STANDALONE );
126
126
temperature.begin();
127
127
humidity.begin();
128
128
pressure.begin();
@@ -133,7 +133,7 @@ If you use a local IDE you can copy & paste the following sketch:
133
133
gas.begin();
134
134
135
135
if (!BLE.begin()){
136
- Serial.println("Failed to initialized Bluetooth® Low Energy !");
136
+ Serial.println("Failed to initialized BLE !");
137
137
138
138
while (1)
139
139
;
@@ -241,7 +241,7 @@ If you use a local IDE you can copy & paste the following sketch:
241
241
}
242
242
243
243
void onHumidityCharacteristicRead(BLEDevice central, BLECharacteristic characteristic){
244
- uint8_t humidityValue = humidity.value();
244
+ uint8_t humidityValue = humidity.value() + 0.5f; //since we are truncating the float type to a uint8_t, we want to round it
245
245
humidityCharacteristic.writeValue(humidityValue);
246
246
}
247
247
@@ -272,6 +272,7 @@ If you use a local IDE you can copy & paste the following sketch:
272
272
273
273
nicla::leds.setColor(r, g, b);
274
274
}
275
+
275
276
```
276
277
277
278
### Connect to the Dashboard
0 commit comments