From 084c61ed9f4192ea11ca494d0153333e11a22fb9 Mon Sep 17 00:00:00 2001 From: "Rufus V. Smith" Date: Mon, 6 Sep 2021 12:09:05 -0400 Subject: [PATCH] allow tone frequency of 0 --- adafruit_magtag/peripherals.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adafruit_magtag/peripherals.py b/adafruit_magtag/peripherals.py index 6ee9ead..50d9da3 100755 --- a/adafruit_magtag/peripherals.py +++ b/adafruit_magtag/peripherals.py @@ -76,8 +76,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