Skip to content

Commit 282ba12

Browse files
Merge pull request #1658 from Narcolessico/patch-1
Fix computation of half wavelength in I2s-library-examples.md
2 parents f14bae4 + e68b0db commit 282ba12

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

content/tutorials/generic/I2s-library-examples/I2s-library-examples.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ const int amplitude = 500; // amplitude of square wave
150150
151151
const int sampleRate = 8000; // sample rate in Hz
152152
153-
const int halfWavelength = (sampleRate / frequency); // half wavelength of square wave
153+
const int halfWavelength = (sampleRate / frequency) / 2; // half wavelength of square wave
154154
155155
short sample = amplitude; // current sample value
156156
int count = 0;
@@ -192,4 +192,4 @@ void loop() {
192192
193193
count++;
194194
}
195-
```
195+
```

0 commit comments

Comments
 (0)