Skip to content

Commit

Permalink
Merge pull request #68 from RufusVS/tone_frequency_0_fix
Browse files Browse the repository at this point in the history
allow tone frequency of 0
  • Loading branch information
FoamyGuy authored Dec 11, 2021
2 parents cf66ddb + 084c61e commit a3e8d28
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions adafruit_magtag/peripherals.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ def play_tone(self, frequency, duration):
It will attempt to play the sound up to 3 times in the case of
an error.
"""
if frequency <= 0:
raise ValueError("The frequency has to be greater than 0.")
if frequency < 0:
raise ValueError("Negative frequencies are not allowed.")
self._speaker_enable.value = True
attempt = 0
# Try up to 3 times to play the sound
Expand Down

0 comments on commit a3e8d28

Please sign in to comment.