File tree Expand file tree Collapse file tree 2 files changed +40
-1
lines changed Expand file tree Collapse file tree 2 files changed +40
-1
lines changed Original file line number Diff line number Diff line change
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
+
1
20
#include < I2S.h>
2
21
3
22
void setup () {
4
23
// 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
5
26
Serial.begin (115200 );
6
27
while (!Serial) {
7
28
; // wait for serial port to connect. Needed for native USB port only
@@ -23,4 +44,3 @@ void loop() {
23
44
Serial.println (sample);
24
45
}
25
46
}
26
-
Original file line number Diff line number Diff line change
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
+
1
19
#include < I2S.h>
2
20
3
21
const int frequency = 440 ; // frequency of square wave in Hz
@@ -13,6 +31,7 @@ void setup() {
13
31
Serial.begin (9600 );
14
32
Serial.println (" I2S simple tone" );
15
33
34
+ // start I2S at the sample rate with 16-bits per sample
16
35
if (I2S.begin (I2S_PHILIPS_MODE, sampleRate, 16 )) {
17
36
Serial.println (" Failed to initialize I2S!" );
18
37
while (1 ); // do nothing
You can’t perform that action at this time.
0 commit comments