Skip to content

Commit 92af4e6

Browse files
committed
edit
1 parent e0e7395 commit 92af4e6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

libraries/ESP_I2S/examples/Simple_tone/Simple_tone.ino

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ i2s_data_bit_width_t bps = I2S_DATA_BIT_WIDTH_16BIT;
4343
i2s_mode_t mode = I2S_MODE_STD;
4444
i2s_slot_mode_t slot = I2S_SLOT_MODE_STEREO;
4545

46-
const int halfWavelength = sampleRate / frequency / 2; // half wavelength of square wave
46+
const unsigned int halfWavelength = sampleRate / frequency / 2; // half wavelength of square wave
4747

4848
int32_t sample = amplitude; // current sample value
4949
unsigned int count = 0;
@@ -70,11 +70,11 @@ void loop() {
7070
sample = -1 * sample;
7171
}
7272

73-
// Left channel, low 8 bit then high 8 bit
73+
// Left channel, the low 8 bits then high 8 bits
7474
i2s.write(sample);
7575
i2s.write(sample >> 8);
7676

77-
// Right channel, low 8 bit then high 8 bit
77+
// Right channel, the low 8 bits then high 8 bits
7878
i2s.write(sample);
7979
i2s.write(sample >> 8);
8080

0 commit comments

Comments
 (0)