Cov txheej txheem:

Dual Xim Bar Teeb Nrog CircuitPython: 5 Cov Kauj Ruam (nrog Duab)
Dual Xim Bar Teeb Nrog CircuitPython: 5 Cov Kauj Ruam (nrog Duab)

Video: Dual Xim Bar Teeb Nrog CircuitPython: 5 Cov Kauj Ruam (nrog Duab)

Video: Dual Xim Bar Teeb Nrog CircuitPython: 5 Cov Kauj Ruam (nrog Duab)
Video: leej twg tej ntxhai - Mang Vang [ Official MV ] 2024, Hlis ntuj nqeg
Anonim
Dual Xim Bar Teeb Nrog CircuitPython
Dual Xim Bar Teeb Nrog CircuitPython

Kuv pom qhov LED kab teeb duab ntawm Pimoroni qhov chaw thiab xav tias nws yuav yog qhov pheej yig thiab txoj haujlwm lom zem thaum ua covid-19 kaw.

Nws muaj 24 LEDS, liab thiab ntsuab, hauv txhua ntawm nws 12 ntu, yog li hauv txoj kev xav koj yuav tsum tuaj yeem tso saib liab, ntsuab thiab daj. Feem ntau koj yuav xav tau 2 anodes, ib qho rau liab thiab ib qho rau ntsuab, thiab 24 cathodes yog tias koj tau tsim nws tawm ntawm 24 LEDs. Cov pob no tsuas muaj 14 tus pin thiab peb khub ntawm tus pin txuas nrog sab hauv!

Koj ua li cas tsav 24 LEDs nrog tsuas yog 11 tus pin? Qhov no zoo li yog qhov haujlwm nthuav dua.

· Peb yuav tsum siv kev nyob ruaj khov ntawm lub qhov muag thiab nyem ntau yam LEDs nrawm heev.

Kuv xav tau dab tsi nrog nws?

· Tsiv ib lub teeb liab, ntsuab lossis daj rov qab mus rau sab nraub qaum

· Zaub liab, ntsuab lossis daj sab laug-txoj kab nyob ntawm cov zaub

Kuv tuaj yeem muab cov tswv yim yooj yim hloov pauv cov zaub li cas?

· Siv 10K lub zog ntsuas los tsim cov txiaj ntsig los ntawm 0 txog 12 suav nrog.

Kuv txiav txim siab siv Adafruit ItsyBitsy M4 Express rau txoj haujlwm no thiab ua haujlwm nws siv CircuitPython. Qhov no yog 3.3V ntaus ntawv yog li kuv txiav txim siab muab 330 Ohm resistors rau ntawm qhov anodes kom ua rau tam sim no qis thiab tiv thaiv microcontroller pins thiab LEDs. Kuv tsuas yog mus teeb qhov siab tshaj ntawm ob LEDs nyob rau lub sijhawm twg los xij - liab thiab ntsuab LED hauv tib ntu kom tau daj.

Kauj Ruam 1: Peb Xav Tau Dab Tsi?

Peb Xav Tau Dab Tsi?
Peb Xav Tau Dab Tsi?

Bar-teeb pob

Itsybitsy M4 nthuav qhia

Strip board los yog breadboard

3 x 330 Ohm resistors

10K Ohm potentiometer

Dhia xaim

Dhia ua

Mu editor los tsim tsab ntawv thiab nyem lub microcontroller.

Kauj Ruam 2: Nws Ua Haujlwm Li Cas

Nws Ua Haujlwm Li Cas
Nws Ua Haujlwm Li Cas

Cov zaub tau muab faib ua 3 ntu (Tsawg - sab laug, Mid - nruab nrab thiab Siab - kawg txoj cai), txhua qhov muaj 4 ntu. Txhua ntu muaj ib qho xaim hluav taws xob 8 LEDs. Cov anode pins tau txuas nrog sab hauv. Pins 1 & 14 rau Tsawg, pins 6 & 9 rau Mid thiab pins 7 & 8 rau Siab - koj tuaj yeem siv ib qho. Cov cathodes liab yog pins 2, 3, 4 thiab 5, thaum ntsuab cathodes yog 13, 12, 11 thiab 10.

Txhawm rau hloov ntawm LED qhov tam sim no yuav tsum ntws los ntawm 300 Ohm resistor los ntawm HIGH anode (3.3V) mus rau LOW (0V) cathode pin.

Txhawm rau ua ntu ntu qis tshaj RED:

anode tus pin 1 tau teeb tsa siab thaum lwm tus pin anode, 6 thiab 7 tau teeb tsa qis (xaiv ntu)

thiab

liab cathode 2 tau teeb tsa qis thaum tag nrho lwm cov cathode pins tau teeb tsa siab (xaiv LED)

Txhawm rau ua ntu ntu raug cai GREEN:

anode pin 7 tau teeb tsa siab thaum lwm tus pin anode, 6 thiab 1 tau teeb tsa qis (xaiv ntu)

thiab

ntsuab cathode 10 tau teeb tsa qis thaum tag nrho lwm cov cathode pins tau teeb tsa siab (xaiv LED)

Kauj Ruam 3: Txuas Txuas Qhov

Txuas Txuas Qhov
Txuas Txuas Qhov

Kuv siv lub rooj tsav nkoj tab sis koj tuaj yeem sim ua daim ntawv qhia zaub mov. Saib nplooj ntawv tom ntej rau duab.

Kauj Ruam 4: Ua tiav Pawg Thawj Coj

Tiav Board
Tiav Board

Kuv siv Mu editor los tsim cov cai thiab nyem nws mus rau ItsyBitsy M4 Express.

Nov yog cov cai:

Kauj ruam 5:

Daim vis dis aus no qhia txog txoj haujlwm tiav ua haujlwm. Cov xim daj zoo li yog txiv kab ntxwv ntau dua li daj, tej zaum vim tias liab LED ci dua li ntsuab. Koj tuaj yeem ntxiv cov tshuaj tiv thaiv me me rau cov kab txuas liab cathode kom txo qhov liab siv.

Kuv vam tias koj yuav muab nws mus.

Pom zoo: