You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/hardware/03.nano/boards/nano-33-ble-sense/tutorials/cheat-sheet/ble-cheat-sheet.md
+142Lines changed: 142 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -212,6 +212,148 @@ If you want to learn more on how to use the IMU, please check out the tutorial b
212
212
-[Accessing IMU accelerometer data with Nano 33 BLE sense](/tutorials/nano-33-ble-sense/imu_accelerometer)
213
213
-[Accessing IMU magnetometer data with Nano 33 BLE sense](/tutorials/nano-33-ble-sense/imu_magnetometer)
214
214
215
+
## Proximity and Gesture Detection
216
+
217
+

218
+
219
+
### APDS9960
220
+
221
+
The **APDS9960** chip allows for measuring digital proximity and ambient light as well as for detecting RGB colors and gestures.
222
+
223
+
### APDS9960 Library
224
+
225
+
To access the data from the APDS9960 module, we need to install the [APDS9960](https://github.com/arduino-libraries/Arduino_APDS9960) library, which comes with examples that can be used directly with the Nano 33 BLE Sense.
226
+
227
+
It can be installed directly from the library manager through the IDE of your choice. To use it, we need to include it at the top of the sketch:
228
+
229
+
```arduino
230
+
#include <Arduino_APDS9960.h>
231
+
```
232
+
233
+
And to initialize the library, we can use the following command inside `void setup()`.
Then we check if there is data available from the proximity sensor. If there is we can print the value in the serial monitor. The value can range between 0-255, where 0 is close and 255 is far away. If it prints the value -1, it indicates an error.
242
+
243
+
```arduino
244
+
if (APDS.proximityAvailable()) {
245
+
Serial.println(APDS.readProximity());
246
+
}
247
+
```
248
+
249
+
### Tutorials
250
+
251
+
If you want to learn more on how to use the proximity sensor, please check out the tutorial below:
252
+
253
+
-[Proximity Detection with the Nano 33 BLE Sense](https://docs.arduino.cc/tutorials/nano-33-ble-sense/proximity_sensor)
254
+
-[Gesture Recognition with the Nano 33 BLE Sense](https://docs.arduino.cc/tutorials/nano-33-ble-sense/gesture_sensor)
255
+
256
+
## Temperature and Humidity sensor
257
+
258
+

259
+
260
+
### HTS221
261
+
262
+
The **HTS221** capacitive digital sensor measures relative humidity and temperature. It has a temperature accuracy of ± 0.5 °C (between 15-40 °C) and is thereby perfectly suited to detect ambient temperature.
263
+
264
+
### HTS221 Library
265
+
266
+
To access the data from the HTS221 module, we need to install the [HTS221](https://github.com/arduino-libraries/Arduino_HTS221) library, which comes with examples that can be used directly with the Nano 33 BLE Sense.
267
+
268
+
It can be installed directly from the library manager through the IDE of your choice. To use it, we need to include it at the top of the sketch:
269
+
270
+
```arduino
271
+
#include <Arduino_HTS221.h>
272
+
```
273
+
274
+
And to initialize the library, we can use the following command inside `void setup()`.
275
+
276
+
```arduino
277
+
if (!HTS.begin()) {
278
+
Serial.println("Failed to initialize humidity temperature sensor!");
279
+
}
280
+
```
281
+
282
+
Then we can print our values in the serial monitor to check the temperature and humidity values.
283
+
284
+
```arduino
285
+
Serial.println(HTS.readTemperature());
286
+
Serial.println(HTS.readHumidity());
287
+
```
288
+
289
+
### Tutorial
290
+
291
+
If you want to learn more on how to use the temperature and humidity sensor, please check out the tutorial below:
292
+
293
+
-[Reading Temperature & Humidity on Nano 33 BLE Sense](https://docs.arduino.cc/tutorials/nano-33-ble-sense/humidity_and_temperature_sensor)
The **LPS22HB** picks up on barometric pressure and allows for a 24-bit pressure data output between 260 to 1260 hPa. This data can also be processed to calculate the height above sea level of the current location.
302
+
303
+
### LPS22HB Library
304
+
305
+
To access the data from the LPS22HB module, we need to install the [LPS22HB](https://github.com/arduino-libraries/Arduino_LPS22HB) library, which comes with examples that can be used directly with the Nano 33 BLE Sense.
306
+
307
+
It can be installed directly from the library manager through the IDE of your choice. To use it, we need to include it at the top of the sketch:
308
+
309
+
```arduino
310
+
#include <Arduino_LPS22HB.h>
311
+
```
312
+
313
+
And to initialize the library, we can use the following command inside `void setup()`.
314
+
315
+
```arduino
316
+
if (!BARO.begin()) {
317
+
Serial.println("Failed to initialize pressure sensor!");
318
+
}
319
+
```
320
+
321
+
Then we can read the values from the sensor using the code below.
322
+
323
+
```arduino
324
+
BARO.readPressure();
325
+
```
326
+
327
+
### Tutorial
328
+
329
+
If you want to learn more on how to use the temperature and humidity sensor, please check out the tutorial below:
330
+
331
+
-[Access Barometric Pressure Sensor Data on Nano 33 BLE Sense](https://docs.arduino.cc/tutorials/nano-33-ble-sense/barometric_sensor)
The **MP34DT05** is a compact, low-power omnidirectional digital MEMS microphone with an IC interface. It has a 64 dB signal-to-noise ratio, is capable of sensing acoustic waves and can operate in temperatures of -40 °C to +85 °C.
340
+
341
+
### PDM Library
342
+
343
+
To access the data from the MP34DT05, we need to use the [PDM](https://www.arduino.cc/en/Reference/PDM) library that is included in the **Arduino Mbed OS Nano Boards** core. If the core is installed, you will find an example that works by browsing **File > Examples > PDM > PDMSerialPlotter**.
344
+
345
+
***Please note: The sampling frequency in the PDMSerialPlotter example is set to 16000 Hz. If the microphone appears to not be working (monitor is printing a value of -128), try to change this rate to 20000 Hz. You can change this at the top of the PDMSerialPlotter example sketch.***
346
+
347
+
```arduino
348
+
static const int frequency = 20000; //frequency at 20 KHz instead of 16 KHz
349
+
```
350
+
351
+
### Tutorial
352
+
353
+
If you want to learn more on how to use the Microphone, please check out the tutorial below:
354
+
355
+
-[Controlling the On-Board RGB LED with Microphone](https://docs.arduino.cc/tutorials/nano-33-ble-sense/microphone_sensor)
356
+
215
357
## RGB
216
358
217
359
To turn ON the pixels, write a `HIGH` state to the LED:
0 commit comments