Skip to content

PWMBuzzer and Speaker refactor #29

@martinohanlon

Description

@martinohanlon

As an experiment I have refactored PWMBuzzer and Speaker.

My aims were:

  • to simplify PWMBuzzer
  • have PWMBuzzer still act like a simple Buzzer (e.g. you can turn it on and off using a button, but its frequency and volume can be set)
  • refactor Speaker so that rather than being a factory, it is a more complex OutputDevice similar to RBGLED.

This code is in a seperate branch - https://github.com/RaspberryPiFoundation/picozero/tree/speaker

You can see the PR here - #28

This looks/feels like a simpler implementation, doesnt confuse PWMBuzzer and appears to support the same function set.

@tracygardner

What do you think? If you are ok with it, I will pull it into dev.

There is some missing functionality from the original here - https://github.com/RaspberryPiFoundation/picozero/pull/28/files#diff-7d562e79b5dec9a5ca24810cfd4d70ff492c0dad33a569e1652693ee7ab79aabR651 - I wasnt sure what it was meant to do.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions