Skip to content

removing 2.0 code #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 7, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions adafruit_circuitplayground/express.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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


Expand Down