Skip to content

Commit a3e8d28

Browse files
authored
Merge pull request #68 from RufusVS/tone_frequency_0_fix
allow tone frequency of 0
2 parents cf66ddb + 084c61e commit a3e8d28

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

adafruit_magtag/peripherals.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ def play_tone(self, frequency, duration):
7777
It will attempt to play the sound up to 3 times in the case of
7878
an error.
7979
"""
80-
if frequency <= 0:
81-
raise ValueError("The frequency has to be greater than 0.")
80+
if frequency < 0:
81+
raise ValueError("Negative frequencies are not allowed.")
8282
self._speaker_enable.value = True
8383
attempt = 0
8484
# Try up to 3 times to play the sound

0 commit comments

Comments
 (0)