Skip to content

Commit bd767e7

Browse files
committed
add some comments to the examples
1 parent e88530a commit bd767e7

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

libraries/I2S/examples/InputSerialPlotter/InputSerialPlotter.ino

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,28 @@
1+
/*
2+
This example reads audio data from an Invensense's ICS43432 I2S microphone
3+
breakout board, and prints out the samples to the Serial console. The
4+
Serial Plotter built into the Arduino IDE can be used to plot the audio
5+
data (Tools -> Serial Plotter)
6+
7+
Circuit:
8+
* Arduino/Genuino Zero or MKR1000 board
9+
* ICS43432:
10+
* GND connected GND
11+
* 3.3V connected 3.3V
12+
* WS connected to pin 0 (Zero) or pin 3 (MKR1000)
13+
* CLK connected to pin 1 (Zero) or pin 2 (MKR1000)
14+
* SD connected to pin 9 (Zero) or pin A6 (MKR1000)
15+
16+
created 17 November 2016
17+
by Sandeep Mistry
18+
*/
19+
120
#include <I2S.h>
221

322
void setup() {
423
// Open serial communications and wait for port to open:
24+
// A baud rate of 115200 is used instead of 9600 for a faster data rate
25+
// on non-native USB ports
526
Serial.begin(115200);
627
while (!Serial) {
728
; // wait for serial port to connect. Needed for native USB port only
@@ -23,4 +44,3 @@ void loop() {
2344
Serial.println(sample);
2445
}
2546
}
26-

libraries/I2S/examples/SimpleTone/SimpleTone.ino

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
This example generates a square wave based tone at a specified frequency
3+
and sample rate. Then outputs the data using the I2S interface to a
4+
MAX08357 I2S Amp Breakout board.
5+
6+
Circuit:
7+
* Arduino/Genuino Zero or MKR1000 board
8+
* MAX08357:
9+
* GND connected GND
10+
* VIN connected 5V
11+
* LRC connected to pin 0 (Zero) or pin 3 (MKR1000)
12+
* BCLK connected to pin 1 (Zero) or pin 2 (MKR1000)
13+
* DIN connected to pin 9 (Zero) or pin A6 (MKR1000)
14+
15+
created 17 November 2016
16+
by Sandeep Mistry
17+
*/
18+
119
#include <I2S.h>
220

321
const int frequency = 440; // frequency of square wave in Hz
@@ -13,6 +31,7 @@ void setup() {
1331
Serial.begin(9600);
1432
Serial.println("I2S simple tone");
1533

34+
// start I2S at the sample rate with 16-bits per sample
1635
if (I2S.begin(I2S_PHILIPS_MODE, sampleRate, 16)) {
1736
Serial.println("Failed to initialize I2S!");
1837
while (1); // do nothing

0 commit comments

Comments
 (0)