From a063ae396c8e9961de13e38b296a1b6976e8c965 Mon Sep 17 00:00:00 2001 From: karengineering <49111213+karengineering@users.noreply.github.com> Date: Mon, 6 May 2019 11:39:46 -0400 Subject: [PATCH] removing 2.0 code no longer backwards compatible, raised NotImplementedError exception; future proposal: can include link to CircuitPython update instructions --- adafruit_circuitplayground/express.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/adafruit_circuitplayground/express.py b/adafruit_circuitplayground/express.py index f9eeaaf..ec89769 100755 --- a/adafruit_circuitplayground/express.py +++ b/adafruit_circuitplayground/express.py @@ -577,7 +577,7 @@ def _generate_sample(self, length=100): self._sample = audioio.AudioOut(board.SPEAKER) self._sine_wave_sample = audioio.RawSample(self._sine_wave) else: - self._sample = audioio.AudioOut(board.SPEAKER, self._sine_wave) + raise NotImplementedError("Please use CircuitPython 3.0 or higher.") def play_tone(self, frequency, duration): @@ -633,9 +633,7 @@ def start_tone(self, frequency): if not self._sample.playing: self._sample.play(self._sine_wave_sample, loop=True) else: - self._sample.frequency = int(len(self._sine_wave) * frequency) - if not self._sample.playing: - self._sample.play(loop=True) + raise NotImplementedError("Please use CircuitPython 3.0 or higher.") def stop_tone(self): """ Use with start_tone to stop the tone produced. @@ -690,10 +688,7 @@ def play_file(self, file_name): while audio.playing: pass else: - with audioio.AudioOut(board.SPEAKER, open(file_name, "rb")) as audio: - audio.play() - while audio.playing: - pass + raise NotImplementedError("Please use CircuitPython 3.0 or higher.") self._speaker_enable.value = False