Browse Source

tone() minimum frequency is 1 Hz

teensy4-core
PaulStoffregen 7 years ago
parent
commit
bb72c33d14
1 changed files with 1 additions and 0 deletions
  1. +1
    -0
      teensy3/Tone.cpp

+ 1
- 0
teensy3/Tone.cpp View File

@@ -73,6 +73,7 @@ void tone(uint8_t pin, uint16_t frequency, uint32_t duration)
} else {
count = 0xFFFFFFFD;
}
if (frequency < 1) frequency = 1; // minimum is 1 Hz
usec = (float)500000.0 / (float)frequency;
config = portConfigRegister(pin);


Loading…
Cancel
Save