INHOUDSOPGAWE:

Circuit Playground Express -termometer: 3 stappe
Circuit Playground Express -termometer: 3 stappe

Video: Circuit Playground Express -termometer: 3 stappe

Video: Circuit Playground Express -termometer: 3 stappe
Video: Adafruit Circuit Playground Express and AY-3-8912 proof of concept 2024, Julie
Anonim
Circuit Playground Express -termometer
Circuit Playground Express -termometer

Ek wou 'n kantoortermometer hê. In plaas daarvan om een te koop, het ek 'n Adafruit Circuit Playground Express gebruik om een te maak. Dit is digitaal/amper analoog. Die kleur toon die temperatuurbereik (groen hier - vir 70's), met die aantal NeoPixels wat die syfers toon (dus is die kantoortemperatuur hier 75). As dit donker is, skakel die skerm uit.

Voorrade

Adafruit Circuit Playground Express

3D -drukker (ek het PLA gebruik)

M3 x 8 skroewe (x4) en M3 moere (x4)

Magnetiese band (https://www.amazon.com/gp/product/B073519752)

Stap 1: Monteer

Mount
Mount
Mount
Mount
Mount
Mount
Mount
Mount

Ek wou 'n bietjie lugvloei terugkry, want ek was nie seker of die bord warm word die lesings sou beïnvloed nie. Die houer is ontwerp in Fusion 360. Model beskikbaar op Thingiverse (https://www.thingiverse.com/thing:3659694). Eerder as om die skroewe in die PLA te probeer hou, het ek 'n spasie gegee om M3 -moere in te sit vir die M3 -skroewe.

Stap 2: Programmeer

Die kode is Circuit Python, met behulp van die Adafruit -biblioteke vir die CPE. Mees onlangse kode beskikbaar op GitHub (https://github.com/KFW/CPE_thermometer), maar dit is redelik basies.

# Kantoortermometer # vir Adafruit Circuit Python Express # Gebruik kleur om temperatuurbereik aan te dui, en dan neopixels vir presiese temp # ligsensor skakel NeoPixels uit as dit donker is van adafruit_circuitplayground. Druk invoer cpx invoer tyd BLANK = (0, 0, 0) BLOU = (0, 0, 24) # 50's BG = (0, 12, 12) # 60's GROEN = (0, 24, 0) # 70's ORANJE = (18, 6, 0) # 80's ROOI = (24, 0, 0) # 90's TEMP_COLOR = {5: BLOU, 6: BG, 7: GROEN, 8: ORANJE, 9: ROOI} terwyl True: cpx.pixels.fill (BLANK) # maak seker dat pixels verfris as cpx.light> 10: # moenie temp vertoon as die kamer donker is nie temp = int (kpx.temperatuur * 1.8 + 32.5) // 10 syfer = temp%10 # vir temp wat eindig met '0', brand slegs pixel 0 (tiende pixel soos gemonteer) as syfer == 0: cpx.pixels [0] = TEMP_COLOR [tiene] # anders vul syfers met die kloksgewys in vanaf 7 uur posisie anders: vir i binne bereik (syfer): cpx.pixels [9 - i] = TEMP_COLOR [tiene] # gebruik '9 -' sin ce pixels # in omgekeerde volgorde tyd. slaap (60) # siklus elke 60 sekondes

Stap 3: Monteer

Mount
Mount

Ek het 'n magneetband aan die agterkant gebruik om dit vas te maak.

Aanbeveel: