8000 set Tone maximum frequency to 20KHz (was 5KHz) · esp8266/Arduino@30df0ae · GitHub
[go: up one dir, main page]

Skip to content

Commit 30df0ae

Browse files
committed
set Tone maximum frequency to 20KHz (was 5KHz)
1 parent a5eb7ea commit 30df0ae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cores/esp8266/Tone.cpp

Lines changed: 2 additions & 2 deletions
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); // 5KHz maximum tone for Arduino compatibility
39-
low = std::max(low, (uint32_t)100); // (100us high + 100us low period = 5KHz)
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)
0