From 0fa70ec988b4d48b3ef6c64713b12985c00ea54f Mon Sep 17 00:00:00 2001 From: Glenn Ruben Bakke Date: Thu, 18 May 2017 23:07:34 +0200 Subject: [PATCH] nrf5/examples: Adding music example. Only working if bluetooth stack is not enabled. --- nrf5/examples/musictest.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 nrf5/examples/musictest.py diff --git a/nrf5/examples/musictest.py b/nrf5/examples/musictest.py new file mode 100644 index 0000000000..d958543ec3 --- /dev/null +++ b/nrf5/examples/musictest.py @@ -0,0 +1,13 @@ +# +# Example usage where "A3" is the Buzzer pin. +# +# from musictest import play +# play("A3") +# + +from machine import Pin +import music + +def play(pin_str): + p = Pin(pin_str, mode=Pin.OUT) + music.play(music.PRELUDE, pin=p)