Skip to content

Commit

Permalink
tone() minimum frequency is 1 Hz
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulStoffregen committed Dec 9, 2017
1 parent 1cf5d3b commit bb72c33
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions teensy3/Tone.cpp
Expand Up @@ -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);

Expand Down

0 comments on commit bb72c33

Please sign in to comment.