制造商零件编号 3333
CIRCUIT PLAYGROUND EXPRESS
Adafruit Industries LLC
所订产品一般在 7-10个工作日 内送达中国,具体时间取决于收货地点。
最低订购金额为人民币 300 元,顺丰快递免运费配送。
当用人民币下单时,按照国际贸易条款 DDP(DigiKey 支付关税、海关费用和当地税款)方式结算。
电汇预付
更多来自全授权合作伙伴的产品
下单后,从合作伙伴发货平均需要时间 1-3 天,也可能产生额外运费。可能另外收取运费。 实际发货时间请留意产品详情页、购物车和结账页面上的说明。
国际贸易结算方式:CPT(交货时支付关税、海关费用和适用 VAT/应付税金)
有关详情,请访问帮助和支持
License: See Original Project Circuit Playground
Many kids dream of becoming a firefighter, especially when their dad is a firefighter. My son is no different, so I built my son a firetruck bed for his 3rd birthday. It has taken me two years to find the time to create lights and a siren for it, but it was a fun project to do with him. Here is what I created and how I did it.
The Circuit Playground Express is a development board filled with sensors, LEDs, and IO’s for almost any project. I planned to use the capacitive touch input, onboard speaker, and output to a strip of Neopixel LEDs. Then, 3D print an enclosure to look like a firetruck “bubble” light bar. Let’s start with the hardware:
Here is how to connect the LEDs:
Next, a wire will need to be connected to A3 for the Capacitive touch input
The Circuit Playground Express is ready to be programmed. To code with Circuit Python, check out this guide to set up your device.
Once you are ready to go, copy and paste this code in your CIRCUITPY drive as code.py
import random
import time
import board
import neopixel
import touchio
import digitalio
from audioio import WaveFile
from audioio import AudioOut
touch_pad = board.A3
touch = touchio.TouchIn(touch_pad)
spkrenable = digitalio.DigitalInOut(board.SPEAKER_ENABLE)
spkrenable.direction = digitalio.Direction.OUTPUT
spkrenable.value = True
audiofiles = ["siren2.wav", "siren.wav", ""]
def fireeffect():
pixel1.fill((55, 0, 0))
pixel1[random.randrange(45)] = (255, 0, 0)
pixel1[random.randrange(45)] = (200, 30, 0)
pixel1[random.randrange(45)] = (180, 50, 0)
pixel1[random.randrange(45)] = (220, 10, 0)
pixel1 = neopixel.NeoPixel(board.A1, 45, brightness=0.8)
def play_file(filename):
wave_file = open(filename, "rb")
with WaveFile(wave_file) as wave:
with AudioOut(board.SPEAKER) as audio:
audio.play(wave)
while audio.playing:
pass
audio = AudioOut(board.SPEAKER)
wave = WaveFile(open(audiofiles[1], "rb"))
time_started = 0
while True:
pixel1.fill((0, 0, 0))
now = time.monotonic()
if touch.value:
if not audio.playing:
audio.play(wave, loop=True)
time_started = now
if now - time_started < 7:
fireeffect()
elif audio.playing:
audio.stop()
pixel1.fill((0, 0, 0))
Here are the 3D printed files for the light bar:
And here is the assembled light bar:
The way I incorporated the capacitive touch input was to loop a wire out of, then back into, the 3d print model. This will work with an insulated wire and allows for it to read the input without touching bare wire. It will also give it a clean look.
This is the final product. I do like using the on-board speaker, after-all it is in his bedroom, not a fire station, so it doesn’t need to be crazy loud.
谢谢!
敬请关注收件箱中的 DigiKey 新闻与更新!
请输入电子邮件地址