Page 318 - Tasarım Beceri Atölyeleri Öğretmen El Kitabı
P. 318
EK-1
import streams
from community.floyd.rtttl import rtttl
import threading
# import toishield module
from toishield import toishield
# import neopixel module
from neopixel import ledstrips as neo
streams.serial()
# set detection enabled and pumpkin inactive by default
toishield.microphone.detectionEnabled = True
toishield.microphone.activePumpkin = False
# set some variable for sound detection
toishield.microphone.staticMin = 4096
toishield.microphone.staticMax = -4096
toishield.microphone.resetMinMaxCounter = 0
# declare leds to blink!
leds = neo.ledstrip(toishield.led_pin, 16)
leds.setall(0,0,0)
leds.on()
310