Skip to content

Commit 264371b

Browse files
authored
Merge pull request #21 from RufusVS/tone_frequency_0_fix
allow tone frequency of zero
2 parents 265d3b7 + 623195a commit 264371b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

adafruit_funhouse/peripherals.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ def play_tone(frequency: float, duration: float) -> None:
101101
It will attempt to play the sound up to 3 times in the case of
102102
an error.
103103
"""
104-
if frequency <= 0:
105-
raise ValueError("The frequency has to be greater than 0.")
104+
if frequency < 0:
105+
raise ValueError("Negative frequencies are not allowed.")
106106
attempt = 0
107107
# Try up to 3 times to play the sound
108108
while attempt < 3:

0 commit comments

Comments
 (0)