Cov txheej txheem:
- Kauj Ruam 1: Yog li, Dab Tsi Hloov Npe?
- Kauj ruam 2: Yooj yim thaiv thiab ua haujlwm
- Kauj Ruam 3: Cov phiaj xwm
- Kauj Ruam 4: Txoj Haujlwm 1 [pt 1]: '2 Hlau' Bargraph LED Display Controller Hardware
- Kauj Ruam 5: Txoj Haujlwm 1 [pt 2]: '2 Hlau' Bargraph LED Display Controller Software
- Kauj Ruam 6: Project 2: '2 Wire' 7 Segment Display Controller
- Kauj Ruam 7: Txoj Haujlwm 3 [pt 1]: '2 Hlau' 4x4 Led Matrix Display
- Kauj Ruam 8: Txoj Haujlwm 3 [pt 2]: '2 Hlau' 4x4 Led Matrix Display
- Kauj Ruam 9: Xaus
Video: 74HC164 Hloov Sau Npe thiab Koj Arduino: 9 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:31
Hloov cov npe yog ib feem tseem ceeb heev ntawm cov laj thawj digital, lawv ua raws li cov kua nplaum nyob hauv nruab nrab ntawm lub ntiaj teb ua ntu zus thiab ua ntu zus. Lawv txo cov xov tooj suav, siv tus pin thiab tseem pab tshem tawm ntawm koj lub cpu los ntawm kev muaj peev xwm khaws lawv cov ntaub ntawv. Lawv tuaj hauv ntau qhov sib txawv, nrog cov qauv sib txawv rau kev siv sib txawv, thiab cov yam ntxwv sib txawv. Qhov kuv yuav tham txog niaj hnub no yog 74HC164 8 ntsis, ntu nyob rau hauv sib npaug tawm, tsis kaw, hloov pauv npe. Vim li cas? Zoo rau ib qho nws yog ib qho ntawm kev hloov pauv yooj yim tshaj plaws nyob rau ntawd, uas ua rau kev kawm txog nws yooj yim dua, tab sis nws tsuas yog tshwm sim los tsuas yog ib qho kuv muaj (lol!, thiab cuam tshuam nws nrog arduino suav nrog qee qhov qauv ua piv txwv thiab coj hauv kev sib tw Kuv vam tias koj txhua tus nyiam!
Kauj Ruam 1: Yog li, Dab Tsi Hloov Npe?
Raws li tau hais ua ntej lawv tuaj nyob hauv txhua qhov sib txawv, thiab kuv kuj tau hais tias kuv tab tom siv 74HC164 8 ntsis, cov lej sib luag tawm, tsis kaw, hloov npe ua li cas txhua qhov ntawd txhais tau tias?!? Ua ntej, lub npe 74-txhais tau tias nws yog ib feem ntawm tsev neeg 74xx logic, thiab txij li nws cov laj thawj nws tsis tuaj yeem tswj tau tam sim no ntau heev (16-20ma rau tag nrho cov nti yog ib txwm muaj), nws tsuas yog hla cov cim ib puag ncig, tab sis qhov ntawd tsis txhais tau tias HC txhais tau hais tias nws lub cuab yeej siv cmos ceev, koj tuaj yeem nyeem txog qhov ntawd ntawm qhov txuas hauv qab no, tab sis yam koj yuav tsum xav paub txog qhov ntawd yog qhov qis lub zog ntaus ntawv thiab yuav khiav ntawm 2 txog 5 volts (yog li yog koj siv 3.3 volt arduino koj ua tau zoo) Tsis tas li nws tuaj yeem ua haujlwm kom raug ntawm qhov nrawm no tshwj xeeb nti muaj qhov nrawm ntawm 78mhz, tab sis koj tuaj yeem mus qeeb lossis nrawm dua (kom txog thaum nws pib goofing li) raws li koj xav tau www.kpsec.freeuk.com/components/74series.htm164 yog tus lej tus lej rau cov nti no, muaj daim duab loj ntawm lawv ntawm wikipediaen.wikipedia.org/wiki/List_of_7400_series_integrated_circuits Tom ntej, 8 ntsis Ib daim ntawv teev npe ua haujlwm yog ua los ntawm cov flip flop circuits, lub flip flop yog 1 me ntsis ntawm kev nco, qhov no yog ib s 8 (lossis 1 byte nco). Txij li nws yog lub cim xeeb, yog tias koj tsis tas yuav hloov kho cov npe koj tuaj yeem tso tseg "tham" rau nws thiab nws yuav nyob hauv lub xeev twg koj tso nws tseg, kom txog thaum koj "tham" rau nws dua lossis rov pib dua lub zog. lwm 7400 cov laj thawj kev hloov pauv cov npe tuaj yeem nce mus txog 16 ntsis ntu hauv qhov sib npaug tawm Qhov no txhais tau tias koj cov arduino xa nws cov ntaub ntawv ib ntus (tawm ntawm pulses ib qho tom qab lwm qhov) thiab kev hloov pauv rau npe chaw txhua qhov me ntsis ntawm tus pin tso tawm raug. Cov qauv no tsuas yog xav tau 2 xov hlau los tswj, yog li koj tuaj yeem siv 2 tus lej digital ntawm arduino, thiab ua txhaum cov 2 tawm mus rau 8 ntau qhov tso tawm digital qee qhov lwm cov qauv sib luag hauv cov lej tawm, lawv ua tib yam tab sis raws li kev nkag mus rau arduino (piv txwv li NES gamepad) tsis kaw Qhov no yuav yog qhov poob ntawm cov nti no yog tias koj xav tau. Raws li cov ntaub ntawv nkag mus rau npe hloov pauv ntawm cov lej, nws qhia txog thawj tus pin tso tawm, thaum lub moos mem tes nkag mus, thawj qhov hloov pauv me ntsis ntawm 1 qhov chaw, tsim kom muaj kev cuam tshuam ntawm cov txiaj ntsig, piv txwv li 00000001 yuav tshwm ntawm qhov tso tawm. zoo li 101001000100001000001000000100000001 Yog tias koj tham nrog lwm cov cuab yeej logic uas sib koom tib lub sijhawm thiab tsis xav txog qhov no, nws tuaj yeem tsim teeb meem. Latched shift registers muaj ib qho ntxiv ntawm kev nco, yog li thaum cov ntaub ntawv tau ua tiav rau hauv kev sau npe koj tuaj yeem tig qhov hloov pauv thiab qhia cov txiaj ntsig, tab sis nws ntxiv lwm cov xov hlau, software, thiab yam khoom kom ua raws. peb tab tom tswj cov lus qhia LED, qhov ua kom nrawm tshwm sim sai heev koj tsis pom nws (tshwj tsis yog thaum koj qhib thawj zaug ntawm lub nti), thiab ib zaug byte yog nyob rau hauv kev hloov pauv rau npe tsis muaj ntau dua scrolling Peb yuav tswj hwm kab lus hom, 7 ntu, thiab 16LED 4x4 dot matrix nrog cov nti no thiab software ntawm arduino siv tsuas yog 2 tus pin (+ lub zog thiab hauv av)
Kauj ruam 2: Yooj yim thaiv thiab ua haujlwm
Kev Txuas Hluav Taws Xob 74HC164 yog 14 tus pin, nws muaj 4 tus pin nkag, 8 tus pin tso zis, lub zog thiab hauv av, yog li cia pib los ntawm sab saum toj. Pins 1 thiab 2 yog ob qho tib si nkag mus, lawv tau teeb tsa raws li qhov laj thawj THIAB rooj vag, txhais tau tias lawv ob leeg yuav tsum muaj logic siab (piv txwv li 5 volts) txhawm rau kom pom me ntsis li 1, lub xeev qis (0 volts) ntawm ib qho twg yuav nyeem ua xoom. Peb tsis xav tau qhov no tiag tiag thiab nws yooj yim dua nrog software, yog li xaiv ib qho thiab khi nws rau V+ yog li nws ib txwm nyeem siab. Kuv xaiv siv lub jumper los ntawm tus pin 1 rau tus pin 14 (V+) txij li koj tuaj yeem tsuas yog qhib lub khob cij jumper hla lub nti. Ib qho ntxiv cov lej txuas ntxiv (tus pin 2 hauv kuv cov lej) yuav tau txais tus lej digital 2 ntawm arduino. Pins 3, 4, 5, thiab 6 ntawm 74HC164 yog thawj 4 bytes ntawm cov zis Pin 7 txuas rau hauv av dhia mus rau sab xis, tus pin 8 yog lub moos tus pin, qhov no yog yuav ua li cas pauv npe paub qhov txuas ntxiv tom ntej tau npaj rau nws nyeem, qhov no yuav tsum txuas nrog digital pin 3 ntawm arduino. Pin 9 yog tshem tag nrho cov npe ib zaug, yog tias nws qis, koj muaj qhov kev xaiv siv nws, tab sis tsis muaj dab tsi hauv qhov tsis txaus ntseeg no, yog li khi nws rau V+pins 10, 11 12 thiab 13 yog qhov kawg 4 bytes ntawm outputpin 14 yog lub zog ua haujlwm thawj zaug koj xav tau teeb tsa cov lus nkag ntawm daim ntawv sau npe (tus lej pin 2 ntawm arduino) siab lossis qis, tom ntej no koj yuav tsum tau tig lub moos tus pin (tus lej digital 3) los ntawm qis mus rau siab, qhov hloov pauv npe yuav nyeem cov ntaub ntawv ntawm cov lej nkag thiab hloov cov pins tso tawm los ntawm 1, rov ua dua 8 zaug thiab koj tau teeb tsa tag nrho 8 qhov kev tso tawm qhov no tuaj yeem ua tiav los ntawm txhais tes nrog rau loops thiab sau digital hauv arduino IDE, tab sis txij li t nws yog ib qho kev sib txuas lus kho vajtse zoo heev (SPI) lawv muaj ib txoj haujlwm uas ua rau koj. shiftOut (dataPin, clockPin, bitOrder, tus nqi) Tsuas yog qhia nws qhov twg cov ntaub ntawv thiab moos pins txuas nrog rau arduino, txoj kev xa cov ntaub ntawv thiab xa dab tsi, thiab nws tau saib xyuas rau koj (ke)
Kauj Ruam 3: Cov phiaj xwm
Yog lawm, muaj lus piav qhia txaus thiab kev xav, cia ua qee yam lom zem nrog cov nti no! Muaj 3 txoj haujlwm los sim hauv cov lus qhia no, thawj 2 yog qhov yooj yim thiab tuaj yeem ua mov ci tawm hauv lub sijhawm. Qhov thib peb, 4x4 coj matrix, xav tau sijhawm ntau dua thiab xav tsim, vim yog coj kab thaiv. List ntawm ntu ntu Project 1: '2 Hlau' bargraph LED zaub tswj 1 * 74HC164 Shift register1 * solderless breadboard1 * arduino, lossis arduino sib xws (5v) 1 * 330 ohm 1/4 watt resistor 8 * ib txwm tso tawm liab LED's 12 * jumper wires Project 2: '2 Hlau' 7 ntu ntu tswj hwm 1 * 74HC164 Shift register1 * solderless breadboard1 * arduino, lossis arduino tau tshaj (5v) 1 * 330 ohm 1/4 watt resistor 1 * hom cathode xya ntu tso tawm 9 * jumper xov hlau Project 3: '2 Hlau' 4x4 coj matrix zaub 1 * 74HC164 Shift register1 * arduino, lossis arduino sib xws (5v) 4 * 150 ohm 1 1/4 watt resistor8 * 1Kohm 1/8 watt resistor (lossis loj dua) 8 * NpN transistor (2n3904 lossis zoo dua) 16 * ib txwm tso tawm liab LED's txhais tau tias tsim nws thiab tswj 5 volt zog uas tuaj yeem ua haujlwm 160+ma (koj tuaj yeem tig tag nrho cov LED ib zaug zoo li lub teeb nres)
Kauj Ruam 4: Txoj Haujlwm 1 [pt 1]: '2 Hlau' Bargraph LED Display Controller Hardware
Nqa mus rau arduino thiab hloov pauv npe raws li cov txheej txheem, Kuv twb muaj 10 ntu ntu kab lus qhia npaj rau kev siv lub rooj noj mov thiab qhov ntawd yog qhov koj yuav pom hauv daim duab, tab sis koj tuaj yeem ua tib yam nrog tus kheej coj ntawm nplooj ntawv thib ob. Kuv tau hais tias cov no tsis yog cov cuab yeej tsav tsheb, hais tias lawv yog cov cuab yeej siv logic, nrog qhov me me tam sim no tuaj yeem hla dhau lawv. Txhawm rau khiav 8 LEDs, thaum ua kom yooj yim hauv Circuit Court, thiab tsis ua zaub mov hloov pauv, xav kom peb txwv qhov tam sim no me ntsis. Lub LED tau xaim ua ke thiab sib koom ua ke (ib qho cathode), ua ntej nkag mus rau lub zog. muab cov av lawv yuav tsum dhau los ntawm 330 ohm resistor, txwv tag nrho cov nyiaj tam sim no uas txhua tus LED tuaj yeem siv tau mus rau 10ma (ntawm 5 volts) Qhov no tawm ntawm LED nyob rau hauv lub xeev saib mob tab sis lawv ua teeb thiab yog li ua haujlwm rau qhov piv txwv no, txhawm rau tsav cov LED ntawm lawv qhov tsim nyog tam sim no koj yuav tsum tau ntxig lub transistor qhov chaw ua haujlwm hloov pauv tuaj yeem qhib / tawm qhov chaw siab dua tam sim no (saib qhov project 3) Cov ntaub ntawv tus lej ntawm kev hloov npe (tus pin 2) xav tau txhawm rau txuas rau arduino tus lej digital # 2 Lub moos tus pin ntawm kev hloov npe (tus pin 8) xav tau txuas rau arduino tus lej digital # 3
Kauj Ruam 5: Txoj Haujlwm 1 [pt 2]: '2 Hlau' Bargraph LED Display Controller Software
Piv txwv 1: Qhib cov ntaub ntawv "_164_bas_ex.pde" Sab hauv arduino IDE, Nws yog daim duab yooj yim uas tsuas yog tso cai rau koj txheeb xyuas lossis tshem tawm LED's hauv kab lus kab lus Thawj 2 kab txhais tus lej tus lej peb yuav siv rau cov ntaub ntawv thiab moos, Kuv siv #define dhau qhov ua piv txwv, kuv pom nws yooj yim kom nco qab, thiab tsis muaj qhov zoo rau ib lossis lwm qhov ib zaug suav ua #define cov ntaub ntawv 2 #txhais lub moos 3 tom ntej yog qhov tsis muaj teeb tsa teeb tsa, nws tsuas yog ua haujlwm ib zaug, yog li arduino tig rau, teeb tsa daim ntawv teev npe ua haujlwm thiab tsis muaj dab tsi ntxiv los ua. Sab hauv qhov tsis muaj teeb meem teeb tsa peb teeb tsa lub moos thiab cov ntaub ntawv pins li OUTPUT pins, tom qab ntawd siv qhov shiftOut muaj nuj nqi peb xa cov ntaub ntawv mus rau kev hloov pauv sau npe tsis muaj teeb tsa () {pinMode (moos, OUTPUT); // ua lub moos tus pin tso zis pinMode (cov ntaub ntawv, OUTPUT); // ua cov ntaub ntawv tus pin tso zis shiftOut (cov ntaub ntawv, moos, LSBFIRST, B10101010); // xa tus lej binary no mus rau npe ua haujlwm} Hauv kev ua haujlwm shiftOut koj tuaj yeem pom nws cov lus sib cav yog cov ntaub ntawv tus lej, moos yog tus lej pin LSBFIRST hais txog qhov kev txiav txim nws li cas, thaum sau nws tawm hauv binary notation (Bxxxxxxxx) keeb kwm yav dhau los B yog Qhov Tsawg Tshaj Plaws Me ntsis Ua Ntej, qhov no tau pub thawj zaug yog li nws xaus rau qhov tso tawm zaum kawg ib zaug tag nrho 8 khoom noj hauv B10101010 yog tus lej Binary raug xa mus rau qhov hloov pauv npe, thiab nws yuav tig rau txhua lub teeb ci., sim ua si nrog cov txiaj ntsig sib txawv los qhib lossis kaw cov qauv sib txawv thiab thaum kawg lub khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob pob (vim tias koj xav tau ib qho txawm tias koj tsis siv nws) void loop () {} // khoob khoob rau tam sim no Piv txwv 2: thawj 8 kab yog tib yam li thawj 8 kab ntawm thawj qhov piv txwv, qhov tseeb lawv yuav tsis hloov pauv rau ib qho ntawm lwm qhov haujlwm, yog li #txhais cov ntaub ntawv 2 #txhais lub moos 3void teeb () {pinMode (moos, OUTPUT); // ua lub moos tus pin tso zis pinMode (cov ntaub ntawv, OUTPUT); // ua cov ntaub ntawv tus pin tso tawm Tab sis tam sim no hauv qhov tsis muaj teeb tsa muaj 8 suav rau lub voj, nws siv qhov khoob khoob thiab hloov 1 ntsis hauv ib lub sijhawm pib los ntawm sab laug me ntsis thiab txav mus sab xis. Qhov no yog thim rov qab los ntawm thawj qhov piv txwv uas peb tau pib los ntawm txoj cai me ntsis thiab ua haujlwm sab laug, tab sis siv MSBFIRST qhov kev hloov pauv ua haujlwm xa cov ntaub ntawv mus rau qhov raug. rau (int i = 0; i <8; ++ i) // rau 0 - 7 ua {shiftOut (cov ntaub ntawv, moos, MSBFIRST, 1 << i); // me ntsis hloov lub logic siab (1) tus nqi los ntawm kuv ncua (100); // ncua 100ms lossis koj yuav tsis tuaj yeem pom nws}} void loop () {} // khoob voj rau tam sim no rub cov ntawv thiab koj yuav tsum tam sim no pom kab lus teeb pom kev txhua lub teeb ib zaug
Kauj Ruam 6: Project 2: '2 Wire' 7 Segment Display Controller
Saib ntawm pinout ntawm koj 7 ntu zaub (Kuv tsuas yog muaj ob qho tab sis tsuas yog siv ib nrab) thiab siv daim duab hauv qab no los txuas txhua ntu rau qhov raug me ntsis ntawm kev hloov pauv npe 1 = tus pin 3bit 2 = tus pin 4bit 3 = tus pin 5bit 4 = tus pin 6 ntsis 5 = tus pin 10bit 6 = tus pin 11bit 7 = tus pin 12bit 8 = tus pin 13 (yog tias koj xav siv tus lej cim zauv) Thiab cov cathode ntawm cov zaub dhau los ntawm 330ohm resistor thiab rau lub hwj chim hauv av pib qhib xya_seg_demo.pde hauv arduino IDEF ua ntej koj pom qhov twg peb txhais cov ntaub ntawv thiab moos pins #define cov ntaub ntawv 2 #txheeb xyuas lub moos 3 Tom ntej no peb teeb tsa txhua tus qauv charater hauv binary, qhov no yooj yim zoo nkauj, saib cov duab hauv qab no, yog tias koj xav tau ntu ntu nruab nrab ntaus hauv ib qho, tom ntej no koj puas xav tau ntu ntu saum toj no, yog li ntaus lwm tus, ua qhov no kom txog thaum koj npog tag nrho 8 ntu, ceeb toom rau kuv sab xis me ntsis (me ntsis 8) yog ib txwm 0, uas yog vim kuv tsis tau tig lub zauv taw tes. byte zero = B01111110; byte ib = B00000110; byte ob = B11011010; byte peb = B11010110; byte plaub = B10100110; byte tsib = B11110100; byte rau = B11111100; byte xya = B01000110; byte yim = B11111110; byte yim = B11111110; tom ntej hauv qhov tsis muaj teeb tsa peb teeb tsa peb cov ntaub ntawv thiab lub moos pins rau qhov tsis ua haujlwm teeb tsa () {pinMode (moos, OUTPUT); // ua lub moos tus pin tso zis pinMode (cov ntaub ntawv, OUTPUT); // ua cov ntaub ntawv tus pin tso tawm 3} tom qab ntawd hauv lub voj void peb siv shiftOut los tso saib txhua tus qauv (tus lej) tos 1/2 ib pliag thiab tso saib tom ntej, 0 txog 9, txij li nws tau ua tiav hauv qhov tsis muaj nuj nqis voj nws yuav suav 0-9 thiab rov ua ib si. void loop () {shiftOut (cov ntaub ntawv, moos, LSBFIRST, xoom); ncua (500); shiftOut (cov ntaub ntawv, moos, LSBFIRST, ib qho); ncua (500); shiftOut (cov ntaub ntawv, moos, LSBFIRST, ob); ncua (500); shiftOut (cov ntaub ntawv, moos, LSBFIRST, peb); ncua (500); shiftOut (cov ntaub ntawv, moos, LSBFIRST, plaub); ncua (500); shiftOut (cov ntaub ntawv, moos, LSBFIRST, tsib); ncua (500); shiftOut (cov ntaub ntawv, moos, LSBFIRST, rau); ncua (500); shiftOut (cov ntaub ntawv, moos, LSBFIRST, xya); ncua (500); shiftOut (cov ntaub ntawv, moos, LSBFIRST, yim); ncua (500); shiftOut (cov ntaub ntawv, moos, LSBFIRST, cuaj); ncua (500);}
Kauj Ruam 7: Txoj Haujlwm 3 [pt 1]: '2 Hlau' 4x4 Led Matrix Display
Qhov project 4x4 LED matrix yog qhov nyuaj me ntsis, tab sis nws yuav luag txhua qhov kev tsim kho, Kuv xaiv los ua kuv cov laug ntawm cov ntoo, tab sis nws yuav tsum muaj peev xwm rov ua dua ntawm lub khob cij, tsuas yog ntau qhov sib nrug. sib txawv hauv qhov kev hloov pauv rau npe tsis yog ncaj qha tsav tus coj, hloov pauv cov ntawv sau npe xa tawm los ntawm 1Kohm resistor mus rau lub hauv paus ntawm NpN transistor, thaum cov zis me ntsis siab, nws tso cai tam sim no thiab qhov hluav taws xob dhau mus rau hauv transistor los hloov qhov kev sib txuas tween tus sau thiab emitter, cov neeg sau khoom tau khi rau "ruaj khov" tswj 5 volts. Qhov emitters ntawm cov transistors tau txuas nrog 150 ohm resistors thiab cov resistors tau txuas rau cov lej ntawm 4 coj ua ke thiab txwv kab mus rau 20ma, txawm hais tias thaum kos duab ntawm cov duab tsuas yog 1 coj nyob rau ntawm ib lub sijhawm, thiab yog li ntawd ze rau qhov ci tag nrho (ze vim tias lawv hloov pauv thiab tawm nrawm heev los ua tag nrho cov duab) Muaj 4 kab thiab 4 kab, txhua tus kab tau txais cov resistor thiab transistor, ntawm txhua kab ntawv LED's cathodes tau khi ua ke, khiav mus rau tus sau ntawm transistor, uas nws lub hauv paus tseem raug tswj los ntawm kev hloov pauv npe, thiab thaum kawg tawm mus rau hauv av. Cov ntawv loj ntawm cov txheej txheem www.instructables.com/files/orig/F7J/52X0/G1ZGOSRQ/F7J52X0G1ZGOSRQ.jpg
Kauj Ruam 8: Txoj Haujlwm 3 [pt 2]: '2 Hlau' 4x4 Led Matrix Display
Kev hloov pauv rau npe tswj hwm ob qho tib si anode thiab cathodes ntawm LED's hauv YX hom ntawv, saib cov hauv qab no 1 = kab 1 (sab xis) me ntsis 2 = kab 2bit 3 = kab 3bit 4 = kab 4bit 5 = kab 1 (saum toj) 6 = kab 2bit 7 = kab 3bit 8 = kab 4 Txhawm rau ua cov duab kos tawm 4x4 square ntawm daim ntawv kab thiab sau cov uas koj xav pom, tom ntej no ua YX lub rooj. Hauv qab no koj yuav pom daim duab ua piv txwv, zoo ib yam tuaj yeem ua rau 4x4 "pixels" Rau txhua qhov ua tiav hauv ntu kuv sau rau kab twg (Y) nws nyob hauv, tom qab ntawv nws nyob hauv (X) Tam sim no qhib cov ntaub ntawv _4x4.pde hauv arduino IDE koj yuav pom peb 2 tus phooj ywg qub #define cov ntaub ntawv 2 #txhais lub moos 3 tom qab ntawd cov lej ntawm integers int img = {1, 1, 4, 1, 1, 3, 4, 3, 2, 4, 3, 4}; Yog tias koj saib nws tsuas yog cov npe ntawm kuv tau sau YX cov haujlwm, nws yuav mob hnyav hauv lub taub qab kom hloov cov txiaj ntsig no los ntawm txhais tes, thiab peb muaj lub khoos phis tawj … cia nws ua nws! peb lub moos thiab cov ntaub ntawv tus pin OUTPUTS void teeb () {pinMode (moos, OUTPUT); // ua lub moos tus pin tso zis pinMode (cov ntaub ntawv, OUTPUT); // ua cov ntaub ntawv pin tus output3} Thiab tsis meej pem nrhiav void voj, kom pib yam tawm peb yuav tsum tshaj tawm qee qhov kev hloov pauv hauv zos tsis muaj dab tsi voj () {int Y; tus X; byte tawm; Tom qab ntawd rau lub voj, lub voj no xav tau kom ntev li ntev npaum li cas ntawm cov npe nkag hauv img array, rau cov duab no kuv tsuas yog siv 6 pixels, yog li ua rau 12 YX tswj hwm. Kuv ua kom nws hla txhua lwm tus lej los ntawm kev siv i += 2, vim tias peb nyeem 2 kev tswj hwm ib lub voj rau (int i = 0; i <12; i += 2) // tus lej ntawm cov ntsiab lus hauv img array, rooj plaub no 12 {Tam sim no peb nyeem Y nkag ntawm hauv kab ntawv, thiab rho tawm ib qho los ntawm nws tus nqi, vim bytes tsis pib ntawm ib qho, lawv pib ntawm xoom, tab sis peb suav los ntawm 1 // tau txais thawj khub YX cov hlua Y = (img - 1); // rho tawm ib qho txij thaum suav me ntsis pib ntawm 0 Tom ntej no peb nyeem X entery ntawm [i + 1] hauv kab lus, thiab rho tawm ib qho los ntawm nws tus nqi, vim yog tib qho laj thawj X = (img [i + 1] - 1); Tom qab peb muaj YX qhov tseem ceeb ntawm lub pixel, peb ua qee qhov me ntsis lossis lej thiab hloov mus rau sab laug. Ua ntej peb yuav tsum tau nyeem tus X tus nqi, thiab txawm li cas los xij nws tus nqi tau hloov nws uas ntau qhov chaw + 4 sab laug, yog li X yog 4 thiab ntxiv 4 nws yog ntsis 8 (MSB), saib ntawm daim duab dua… ntsis 1 = kab ntawv 1 (sab xis) ntsis 2 = kab 2 ntsis 3 = kab 3bit 4 = kab 4bit 5 = kab 1 (saum toj) ntsis 6 = kab 2bit 7 = kab 3 ntsis 8 = kab 4Bit 8 yog kab kawg Tom ntej no tus nqi Y kuj tseem hloov mus rau sab laug, lub sijhawm no tsuas yog los ntawm nws tus kheej, tsis muaj dab tsi ntxiv rau. (nibbles), siv me ntsis lossis (lub cim |) siv ob lub bytes thiab pib ntxiv lawv ua ke, cia xav tias X = 10000000Y = 00000001 -------------------- LOS YOG = 10000001row 4 kem 1 tawm = 1 << (X + 4) | 1 << Y; Thiab thaum kawg shiftOut los tso saib daim duab tam sim no, thiab ua li ntawd kom txog thaum peb tsis muaj cov ntaub ntawv ntxiv hauv kab ntawv … ncua ib pliag thiab txuas mus ib txhis, txij li peb tau hloov cov ntaub ntawv mus rau sab laug thiab peb xav tau MSB kom nyob ntawm tus pin kawg ntawm daim ntawv teev npe ua haujlwm xa nws tawm ua ntej. shiftOut (cov ntaub ntawv, moos, MSBFIRST, tawm); // hloov lub byte tawm mus rau peb ncua sijhawm sau npe (1); // ncua nws kom sai li sai tau kom nws muaj sijhawm los tawm ntawm qhov pom ntawm koj lub qhov muag Xav ua koj tus kheej cov duab, thiab cuam tshuam, Muaj 3 tus qauv ua piv txwv, lub ntsej muag luag ntxhi thiab lub checkerboard (uas zoo li kab txaij), thiab thaum kawg tus tsim sparkle random
Kauj Ruam 9: Xaus
Tshaj tag nrho qhov no yog qhov ua tau zoo me me nti, thiab kuv zoo siab kuv tau muab nws tshem tawm ntawm cov khoom qub ntawm lub tshuab hluav taws xob mus rau lub thoob khib nyiab. dab tsi mus rau yog qhov muaj txiaj ntsig zoo rau cov neeg xav pom zoo li Kuv kuj tseem thov zam txim rau kuv tus lej, kuv tsuas yog muaj cov arduino txij li kev sib tw lub lim tiam thib peb ntawm Lub Kaum Hli, thiab nws yog qhov kev sib tsoo loj heev. Tab sis qhov ntawd yog qhov zoo tshaj plaws ntawm cov kab ke, yog tias koj zaum thiab ua haujlwm nrog nws, nws muaj cov yam ntxwv zoo uas tswj hwm lub ntiaj teb nrog 8 me ntsis microcontroller yooj yim heev ua. Raws li ib txwm muaj lus nug thiab lus pom zoo tshaj plaws, thiab ua tsaug rau nyeem ntawv, Kuv vam tias koj tau kawm ntau yam
Pom zoo:
Yuav Hloov Li Cas Koj Lub Npe WiFi thiab Tus Kheej: 11 Kauj Ruam
Yuav Ua Li Cas Hloov Koj Lub Npe WiFi thiab Tus Kheej: Ntau tus neeg tsis xav tias yooj yim npaum li cas uas koj tuaj yeem hloov koj li ntaub ntawv WiFi xws li lub npe siv thiab tus lej nkag. Nws tsuas yog siv sijhawm me ntsis los ua nws, koj kuj tuaj yeem ua kev lom zem thiab tshwj xeeb ntawm koj li WiFi. Txawm hais tias, cov tuam txhab sib txuas lawv muaj qhov sib txawv me ntsis
Customize Koj Tawv, Nrog Koj Kos Npe Kos Npe: 9 Cov Kauj Ruam
Customize Your Leather, With Your Engraved Signature: Nyob Zoo Txhua Tus, hauv cov lus qhia no peb yuav ua kev cai laser engraving ntawm tawv hnab thiab koj tuaj yeem ua qhov no ntawm cov khoom tawv sib txawv
48 X 8 Scrolling LED Matrix Zaub Siv Arduino thiab Hloov Sau Npe: 6 Kauj Ruam (nrog Duab)
48 X 8 Scrolling LED Matrix Display Siv Arduino thiab Shift Cov Ntawv Sau Npe: Nyob zoo txhua tus! Qhov no yog kuv thawj Kev Qhia thiab nws yog txhua yam hais txog kev ua 48 x 8 Programmable Scrolling LED Matrix siv Arduino Uno thiab 74HC595 hloov npe. Nov yog kuv thawj qhov haujlwm nrog Arduino pawg thawj coj txhim kho. Nws yog qhov kev sib tw muab rau m
3D Luam Flahing LED Lub Npe Tag - Tau Koj Lub Npe hauv Teeb!: 4 Cov Kauj Ruam (nrog Duab)
3D Luam Flahing LED Lub Npe Tag-Tau Koj Lub Npe hauv Teeb!: Nov yog qhov haujlwm zoo me me uas koj tsim lub npe cim uas yog lub ntsej muag zoo nkauj thiab ntxim nyiam siv ntau lub teeb LED.Video cov lus qhia: Rau txoj haujlwm no koj yuav xav tau: 3D Luam Qhov Chaw https://www.thingiverse.com/thing:2687490 Me
Hloov npe thiab Ntxiv Icon rau Koj Thumbdrive: 4 Cov Kauj Ruam
Hloov pauv thiab Ntxiv Icon rau Koj Thumbdrive: Sau cov ntawv yooj yim autorun rau koj tus ntiv tes xoo kom muab lub cim tshiab thiab lub npe