nrf5/examples: Adding music example. Only working if bluetooth stack is not enabled.

This commit is contained in:
Glenn Ruben Bakke 2017-05-18 23:07:34 +02:00 committed by glennrub
parent 1ff44dd5b8
commit 0fa70ec988
1 changed files with 13 additions and 0 deletions

View File

@ -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)