nrf5/examples: Adding music example. Only working if bluetooth stack is not enabled.
This commit is contained in:
parent
1ff44dd5b8
commit
0fa70ec988
|
@ -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)
|
Loading…
Reference in New Issue