circuitpython/ports/nrf/examples/musictest.py
Damien George 69661f3343 all: Reformat C and Python source code with tools/codeformat.py.
This is run with uncrustify 0.70.1, and black 19.10b0.
2020-02-28 10:33:03 +11:00

15 lines
227 B
Python

#
# Example usage where "P3" is the Buzzer pin.
#
# from musictest import play
# play("P3")
#
from machine import Pin
import music
def play(pin_str):
p = Pin(pin_str, mode=Pin.OUT)
music.play(music.PRELUDE, pin=p)