cpb: Disable the onboard speaker until request by jepler · Pull Request #2262 · adafruit/circuitpython · GitHub
Skip to content

cpb: Disable the onboard speaker until request#2262

Merged
dhalbert merged 2 commits into
adafruit:masterfrom
jepler:cpb-speaker-disable
Nov 3, 2019
Merged

cpb: Disable the onboard speaker until request#2262
dhalbert merged 2 commits into
adafruit:masterfrom
jepler:cpb-speaker-disable

Conversation

@jepler

@jepler jepler commented Nov 1, 2019

Copy link
Copy Markdown

This allows the board to disable the onboard speaker until explicitly enabled in user code.

Testing performed on a CPB:

  • Touching the AUDIO pin with a fingertip no longer generates noise/buzz
  • Generating a waveform with simpleio.tone produces no sound by default
  • When the board.SPEAKER_ENABLE is configured as a digital output and
    set True, simpleio.tone does produce sound

Note that while guides should include information about SPEAKER_ENABLE, it's possible that some users who omitted it could view this as a breaking change. They can fix it by simply adding code similar to

speaker_enable = digitalio.DigitalInOut(board.SPEAKER_ENABLE)
speaker_enable.direction = digitalio.Direction.OUTPUT
speaker_enable.value = True

before using the internal speaker.

Closes: #2258

.. the existing code, which was never activated by the preprocessor,
wasn't quite right.
This allows the board to disable the onboard speaker until explicitly
enabled in user code.

Testing performed on a CPB:
 * Touching the AUDIO pin with a fingertip no longer generates noise/buzz
 * Generating a waveform with `simpleio.tone` produces no sound by default
 * When the board.SPEAKER_ENABLE is configured as a digital output and
   set True, `simpleio.tone` does produce sound

Note that while guides should include information about SPEAKER_ENABLE, it's
possible that some users who omitted it could view this as a breaking change.
They can fix it by simply adding code similar to

    speaker_enable = digitalio.DigitalInOut(board.SPEAKER_ENABLE)
    speaker_enable.direction = digitalio.Direction.OUTPUT
    speaker_enable.value = True

before using the internal speaker.

Closes: adafruit#2258
@dhalbert

dhalbert commented Nov 1, 2019

Copy link
Copy Markdown
Collaborator

@tannewt tannewt requested a review from dhalbert November 1, 2019 23:40

@dhalbert dhalbert left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@dhalbert dhalbert merged commit e3638ff into adafruit:master Nov 3, 2019
@jepler jepler deleted the cpb-speaker-disable branch November 3, 2021 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disable CircuitPlayground Bluefruit speaker by default

2 participants