Adafruit_Learning_System_Gu.../CircuitPython_Essentials/CircuitPython_PWM_Piezo_simpleio.py
2018-07-03 19:11:54 -04:00

12 lines
361 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 M4 boards:
# simpleio.tone(board.A1, f, 0.25) # on for 1/4 second
time.sleep(0.05) # pause between notes
time.sleep(0.5)