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/learn/07.built-in-libraries/02.i2s/i2s.md
+30Lines changed: 30 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -110,6 +110,36 @@ None
110
110
#### Returns
111
111
The next sample of incoming I2S data available (or 0 if no data is available)
112
112
113
+
114
+
### `read()`
115
+
116
+
#### Description
117
+
118
+
Reads incoming I2S data from the I2S interface. This method reads and removes the next sample of incoming I2S data available from the internal I2S buffer. read() inherits from the Stream utility class.
119
+
120
+
#### Syntax
121
+
122
+
```
123
+
I2S.read()
124
+
```
125
+
126
+
```
127
+
I2S.read(buffer, length)
128
+
```
129
+
130
+
#### Parameters
131
+
132
+
None (for single sample read)
133
+
134
+
buffer: an array to read data into
135
+
136
+
length: the number of samples to read
137
+
138
+
#### Returns
139
+
140
+
The first sample of incoming I2S data available (or -1 if no data is available) - int
141
+
142
+
For buffer read: the number of samples read into the buffer
0 commit comments