Adafruit_Learning_System_Gu.../CircuitPython_Essentials/CircuitPython_PWM_Piezo_simpleio.py
2018-05-14 19:07:55 +01:00

13 lines
369 B
Python

import time
import board
import simpleio
while True:
for f in (262, 294, 330, 349, 392, 440, 494, 523):
# For the M0 boards:
simpleio.tone(board.A2, f, 0.25) # on for 1/4 second
# For the Metro M4 Express:
# simpleio.tone(board.A1, f, 0.25) # on for 1/4 second
time.sleep(0.05) # pause between notes
time.sleep(0.5)