From 623195af70d1e5262754dca216ee30e3012034cf Mon Sep 17 00:00:00 2001 From: "Rufus V. Smith" Date: Mon, 6 Sep 2021 12:06:57 -0400 Subject: [PATCH] allow tone frequency of zero --- adafruit_funhouse/peripherals.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adafruit_funhouse/peripherals.py b/adafruit_funhouse/peripherals.py index 3ea876a..9a1d1c5 100755 --- a/adafruit_funhouse/peripherals.py +++ b/adafruit_funhouse/peripherals.py @@ -96,8 +96,8 @@ def play_tone(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.") attempt = 0 # Try up to 3 times to play the sound while attempt < 3: