Skip to content

Commit c548958

Browse files
authored
Tone limit 20KHz (#7179)
Set Tone maximum frequency to 20KHz (was 5KHz)
1 parent 483bfde commit c548958

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cores/esp8266/Tone.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ static void _startTone(uint8_t _pin, uint32_t high, uint32_t low, unsigned long
3535

3636
pinMode(_pin, OUTPUT);
3737

38-
high = std::max(high, (uint32_t)100);
39-
low = std::max(low, (uint32_t)100);
38+
high = std::max(high, (uint32_t)25); // new 20KHz maximum tone frequency,
39+
low = std::max(low, (uint32_t)25); // (25us high + 25us low period = 20KHz)
4040

4141
if (startWaveform(_pin, high, low, (uint32_t) duration * 1000)) {
4242
_toneMap |= 1 << _pin;

0 commit comments

Comments
 (0)