Skip to content

Commit d1a3668

Browse files
authored
Merge pull request #61 from arduino/marqdevx/niclaVision/microhpone-fixes
Mic tutorial: Fixes from review
2 parents 26ebabd + 5dbe252 commit d1a3668

File tree

1 file changed

+11
-9
lines changed
  • content/hardware/05.nicla/boards/nicla-vision/tutorials/microphone_sensor

1 file changed

+11
-9
lines changed
+11-9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
2-
title: 'Testing and Controlling the Microphone'
2+
title: 'Reading Audio Samples With the Onboard Microphone'
33
difficulty: easy
4-
compatible-products: [nano-33-ble-sense]
54
description: 'Learn how to create a soundmeter using the built-in microphone with the Nicla Vision.'
65
tags:
76
- OpenMV
@@ -33,17 +32,21 @@ In this tutorial you will use the **Arduino Nicla Vision** board to get the micr
3332
- Get the microphone data.
3433
- Use the PDM(Pulse-density modulation) library.
3534
- Print the microphone values in the Serial Monitor.
36-
- Change RGB brightness with the stored microphone values.
35+
- Change RGB blinking speed with the last microphone reading. (Arduino IDE)
36+
- Show the values on a spectrum analyzer (only with openMV)
3737

3838
### Required Hardware and Software
3939

4040
- [Nicla Vision board](https://store.arduino.cc/products/nicla-vision)
4141
- Latest mbed Core version
42+
- Latest openMV IDE version
4243

4344
## Set Up
4445

4546
To check that you correctly set up the board please visit our [Getting Started Guide](https://docs.arduino.cc/tutorials/nicla-vision/getting-started) for both **OpenMV** and **Arduino** instructions.
4647

48+
## Instructions
49+
4750
### OpenMV
4851

4952
Open the script by going to **Examples > Arduino > NanoRP2040 > Audio > Audio_fft.py**.
@@ -58,29 +61,28 @@ When the script is running, you will see an spectrum analyzer in the top right p
5861

5962
### Arduino
6063

61-
## Instructions
62-
63-
### Setting Up the Sketch
64+
#### Setting Up the Sketch
6465

6566
We will edit the example from the mbed Core, go to **Examples > PDM > PDMSerialPlotter** and save it into your sketchbook.
6667

6768
You can run the sketch to see the result, it will show the data that the microphone is getting on the **Serial Plotter**.
6869

69-
### Controlling the Blinking LED
70+
#### Controlling the Blinking LED
7071

71-
Now that you can get the microphone data, let's control the built-in RGB LED and change the speed of its blinking depending on the values.
72+
Now that you can get the microphone data, let's control the built-in RGB LED and change the speed of its blinking depending on the values by changing the blinking time to the last reading of the microphone, the blink will be slow if the sound is loud, and fast if it is quiet.
7273

7374
You can access the example sketch at **Examples > PDM > PDMSerialPlotter** and then edit as shown in this tutorial.
7475
Or find the full edited sketch in our **Arduino_Pro_Tutorials** library.
7576

76-
### Complete Sketch
77+
#### Complete Sketch
7778

7879
```arduino
7980
/*
8081
This example reads audio data from the on-board PDM microphones, and prints
8182
out the samples to the Serial console. The Serial Plotter built into the
8283
Arduino IDE can be used to plot the audio data (Tools -> Serial Plotter)
8384
Circuit:
85+
- Arduino Nicla Vision, or
8486
- Arduino Nano 33 BLE board, or
8587
- Arduino Nano RP2040 Connect, or
8688
- Arduino Portenta H7 board plus Portenta Vision Shield

0 commit comments

Comments
 (0)