Cov txheej txheem:
- Kauj Ruam 1: Lub Npe Flasher
- Kauj Ruam 2: Lub Hnab Teeb
- Kauj Ruam 3: Tus Xim Scroller
- Kauj ruam 4: Programing
Video: 3 Yooj Yim ATTiny Khoom Plig Nyiaj so koobtsheej: 4 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:31
Txhua xyoo lub caij so so tau ncig thiab kuv tau nyam ntawm qhov yuav muab dab tsi rau kuv cov phooj ywg thiab tsev neeg. Tib neeg ib txwm hais tias nws zoo dua los ua khoom plig rau koj tus kheej dua li yuav nws ntawm lub khw yog li xyoo no kuv tau ua li ntawd. Thawj zaug qhia lub npe lossis cov duab yooj yim thaum nthwv cua, qhov thib ob ploj mus zoo ntawm ob tus coj dawb (Nws kuj muaj tus lej ruaj ntseg txhawm rau txuas nws rau khaub ncaws lossis hnab nyiaj), thiab qhov thib peb yog lub teeb pom kev zoo ntawm kev xaiv, nqes mus seamlessly ntawm cov xim. Txhua yam qis dua $ 15 thiab yooj yim sib sau ua ke tsawg dua ib teev. Koj kuj tseem tuaj yeem muab cov lus qhia no nrog rau cov khoom ua khoom plig rau ib tus neeg nyiam kawm hluav taws xob.
Faj seeb: Ib theem pib ntawm cov khoom siv yog xav tau. Txawm li cas los xij, tsis zoo li kuv cov lus qhia yav dhau los Kuv yuav hais meej txog yuav ua haujlwm li cas AVR. Kuv vam tias qhov no yuav pab cov neeg uas tab tom sim pib siv hluav taws xob. Kuv nco qab thaum kuv nyob ntawd thiab yuav zoo siab ua cov lus nug uas koj muaj. Nco ntsoov tsis muaj lus nug ruam! Kuv tau tso nws qhib rau koj txhawm rau txiav txim siab yuav ua li cas koj yuav teeb tsa koj lub rooj tsav xwm hauv kev cia siab tias koj yuav los nrog txoj hauv kev tshiab ntawm kev nthuav tawm cov kab hluav taws xob yooj yim uas kuv tau kos tawm. Thov tshaj tawm cov duab ib zaug koj ua tiav, Kuv tsis tuaj yeem tos kom pom dab tsi koj tuaj nrog! Qhov rau tag nrho Cov Haujlwm N = tus lej ntawm cov haujlwm x N ATTiny45 (www.digikey.com) x N 8-pin DIP qhov (RadioShack) x 1 Lub Rooj Sib Tham Loj Loj (Kuv tau txais kuv li ntawm RadioShack) x N 3v Npib Cell Roj Teeb thiab tus tuav (RadioShack) x1 Programmer (Kuv siv qhov no thiab cov khoom siv muab khoom yuav raug teeb tsa los siv qhov no) x2 N Resistors, ib 10 ohm thiab ib qho 10k ohm (RadioShack) Nov yog daim duab ntawm peb txoj haujlwm tiav:
Kauj Ruam 1: Lub Npe Flasher
Lwm Qhov X5 DIFFUSED 3mm LED's (RadioShack) Txoj haujlwm no siv kev pom kev tsis tu ncua kom pom cov duab lossis kab ntawv thaum txav nrawm. Nws ua haujlwm zoo dua thaum tsaus ntuj. Nrog AVR peb tab tom hloov ntawm LED kom nrawm dua tom qab ntawd lub qhov muag tuaj yeem pom peb tuaj yeem tsim cov duab hauv huab cua nrog cov khoom siv tsawg heev. Txoj Cai: (Rub tawm.zip cov ntaub ntawv hauv qab ntawm nplooj ntawv rau tus lej, ua cov ntaub ntawv, thiab lwm yam. (Tus lej ntawd tsis muaj cov lus pom dav uas cov cai no ua tab sis yog tias txoj cai no tsis ua haujlwm, sim ib qho hauv zip file)) #define F_CPU 1000000 #include #include void dispClear () {PORTB = ~ 0b00000000; } int main () {DDRB = 0xFF; // Rau cov neeg ntawm koj uas tsis tau nyeem C ua ntej ob qhov slash qhia txog kev tawm tswv yim. Qhov no teev cov pins ntawm avr raws li qhov tso tawm char x = 10; // x yog siv los teeb tsa ncua sijhawm. Ua kom tus nqi muab qeeb qeeb ntawm pixels, txo qis, qis dua thaum (1) // Thaum (qhov xwm txheej muaj tseeb); {Ua Qhov No} (Qhov tseeb hauv C yog 1) {PORTB = ~ 0b00010001; // Kuv tus phooj ywg lub npe yog Zoe yog li kuv tau kos cov cim ntawm daim ntawv kab ntawv thiab tom qab ntawd suav lawv rau hauv PORTB. Thawj peb zeros tsis muaj teeb meem vim tsuas muaj tsib tus coj sib txuas. Ib qho ntawm ib ntawm tsib qhov chaw seem qhia tias LED nyob, xoom, tawm. _delay_ms (x); // ncua sijhawm hauv vib nas this PORTB = ~ 0b00010011; _delay_ms (x); PORTB = ~ 0b00010101; _delay_ms (x); PORTB = ~ 0b00011001; _delay_ms (x); PORTB = ~ 0b00010001; _delay_ms (x); dispClear (); // Qhib qhov chaw nruab nrab ntawm cov cim _delay_ms (x); PORTB = ~ 0b00001110; _delay_ms (x); PORTB = ~ 0b00010001; _delay_ms (x*3); PORTB = ~ 0b00001110; _delay_ms (x); dispClear (); _delay_ms (x); PORTB = ~ 0b00011111; _delay_ms (x); PORTB = ~ 0b00010101; _delay_ms (x); PORTB = ~ 0b00010001; _delay_ms (x); dispClear (); _delay_ms (x*5); // Cov lus tau ua tiav rau kev ncaj ncees Kuv muaj qhov chaw loj dua ntawm cov lus}} Tam sim no ua raws cov lus qhia ntawm nplooj 4 txhawm rau sau cov cai no thiab xa mus rau koj AVR.
Kauj Ruam 2: Lub Hnab Teeb
Lwm Qhov Chaw x2 LED's NON DIFFUSED (RadioShack) Txoj haujlwm no ploj mus zoo ntawm ob lub LED. Kuv niam xav tau ib yam dab tsi mus rau ntawm nws lub hnab nyiaj los pab nws tus muv pom thaum hmo ntuj. Kuv xav tias zoo li lub teeb pom kev tsheb kauj vab yuav ua rau pom kev ntau dhau yog li kuv tau ua qhov no. Nws siv PWM (Pulse Width Modulation) los muab qhov ua kom pom kev thiab ci. Dab tsi yog qhov tshwm sim tiag tiag yog lub teeb ci ntsa iab sai dua qhov muag tuaj yeem pom ntawm qhov sib txawv ua ntu zus los sim qhov kev hloov pauv. Koj tuaj yeem pom qhov no meej dua thaum koj yoj nws ntawm koj lub ntsej muag zoo li koj xav nrog Lub Npe Flasher. Txoj cai tuaj yeem rub tawm ntawm qhov kawg ntawm nplooj ntawv no. Saib phab 4 ntawm yuav ua li cas sau koj li AVR. Hloov chaw ntawm kev hais tawm cov cai ntawm no kuv yuav piav qhia luv luv lub tswv yim. PWM yog tsim los ntawm timer. Txhua lub voj voog teev cov timer suav ib qho. Thaum nws mus txog tus nqi tshwj xeeb (Hauv qhov no OCR1B) nws hloov lub xeev tus lej (Hauv qhov no OC1B). Txhawm rau kom LED tau "hloov tawm" Kuv txuas rau lwm tus rau [OPPOSITE] OC1B (Ntawd yog dab tsi bar hla saum toj kawg nkaus txhais tau tias). Tom qab ntawd peb siv x txhawm rau nce ntxiv thiab txo qis lub sijhawm rau LED's kom nyob.
Kauj Ruam 3: Tus Xim Scroller
Lwm Qhov Chaw X1 RGB LED (diffused zoo dua) (RadioShack) Qhov no rau kuv yog qhov qub. Kuv ib txwm tau fasinated los ntawm cov teeb zoo li no thiab pom lawv nyob ntsiag to yog li ib txwm kuv xav ua ib qho. Tsis tas li lawv qhov pom kev hauv zej zog muab rau lawv qhov WOW tiag. "Koj tau ua li ntawd?!" Cov cai yog ze li qub thiab, hauv kuv lub tswv yim, nyeem tau yooj yim dua. Koj tuaj yeem rub tawm qhov hauv qab. Lub sijhawm no peb muab PWM'd tus pin rau txhua tus pin pin hauv RGB LED. Nyob rau hauv txoj kev no peb hauv av hla lub nti. Volts tuaj yeem ntsuas raws li qhov sib txawv ntawm ob lub ntsiab lus. 3v-0v = 3v 5v-2v = 3v *** 3v-3v = 0v *** Qhov piv txwv kawg no yog yam peb tab tom ua thaum peb tsaws los ntawm cov nti. Thaum muaj peb qhov hluav taws xob ntawm ob sab, ib qho hais, tsis muaj qhov hluav taws xob txaus los tsav LED. Yog li kom ploj ntawm cov xim peb xaiv xim thiab lwm xim. Teem ib qho sib npaug rau x thiab lwm qhov sib npaug rau 255-x lossis INVERSE ntawm x. Zoo li peb tau ua hauv txoj haujlwm yav dhau los. Tam sim no mus rau theem 4 rau program.
Kauj ruam 4: Programing
Ua ntej rub tawm thiab teeb tsa Emacs, avr-gcc, thiab Avrdude thiab ib qho kev cia siab uas lawv yuav muaj. Ntawm Arch linux Kuv tau ua qhov no nrog: sudo pacman -Sy emacs avrdude
Tam sim no nws yog lub sijhawm los txuas koj tus programmer rau koj avr. Hlau tus pin ntawm tus lej 6-tus ISP programmer (daim duab hauv qab no) mus rau tus pin corosponding ntawm koj li AVR (Cov ntaub ntawv, nplooj ntawv 2) (Kuv tau ua qhov no ntawm lub khob cij). Tam sim no ntsaws tus programmer rau koj lub khoos phis tawj thiab QHOV TSEEB kov saum AVR. Yog tias nws kub, ROV QAB PROGRAMMER LOS NTAWM KOJ LUB COMPUTER ATCE ib zaug tshuaj xyuas koj cov kev sib txuas thiab sim dua (Lub Hwj Chim thiab Gnd rov qab?). Yog tias nws tsis kub ces qhib emacs thiab nias Ctl-x Ctl-f txhawm rau nrhiav cov ntaub ntawv.c. Qhib nws thiab tom qab ntawd nias Meta (Usualy Alt) -x thiab ntaus ua ke. Nias nkag ob zaug thiab yog tias koj muaj hmoo koj AVR yuav tsum tam sim no tab tom ua koj tus lej! Tsaug rau kev nyeem ntawv! Kuv vam tias koj nyiam nws thiab kawm qee yam. Thov, tsis txhob ua siab deb nug cov lus nug thiab tsis txhob hnov qab tshaj tawm cov duab ntawm yam koj tuaj nrog. Zoo siab hnub so thiab tsis txhob hnov qab pov npav!
Pom zoo:
Cov Khoom Plig Khoom Plig Khoom Plig Zoo Tshaj Plaws: 13 Kauj Ruam
Cov Khoom Plig Khoom Plig Khoom Plig Zoo Tshaj Plaws: Cov lus qhia no yuav piav qhia thiab piav qhia yuav ua li cas thiaj tsim tau lub tshuab ua khoom siv pub mis pub dawb, tuaj yeem tsim tau nrog cov tais zaub mov txuas nrog. Kuv tau txuas cov vis dis aus ntawm no piav qhia txog cov khoom ua haujlwm li cas thiab nws zoo li cas
D.I.Y YOOJ YIM YOOJ YIM YOOJ YIM YOOJ YIM YOOJ YIM LOS NTAWM SCRAPS: 4 Cov Kauj Ruam (nrog Duab)
D.I.Y YOOJ YIM YOOJ YIM YOOJ YIM YOOJ YIM LOS NTAWM SCRAPS: Hnub no kuv xav qhia yuav ua li cas kom pom lub teeb pom kev zoo los ntawm lub zog xa hluav taws xob tsis siv hluav taws xob los ntawm tus txhuam txhuam hniav thiab lub tshuab solenoid valve coils uas tau khaws los ntawm scrapyard.Ua ntej pib, thov saib cov vis dis aus hauv qab no:
Txoj Kev Yooj Yim thiab Yooj Yim Los Hloov Koj Lub Xauv Screen hauv 6 Cov Kauj Ruam Yooj Yim (Windows 8-10): 7 Kauj Ruam
Txoj Kev Yooj Yim thiab Yooj Yim Los Hloov Koj Lub Xauv Screen hauv 6 Cov Kauj Ruam Yooj Yim (Windows 8-10): Xav hloov pauv yam ntawm koj lub laptop lossis PC? Xav tau kev hloov pauv hauv koj qhov chaw? Ua raws cov kauj ruam no yooj yim thiab yooj yim kom ua tiav koj tus kheej lub computer ntsuas phoo
YUAV UA LI CAS YOOJ YIM YOOJ YIM YOOJ YIM YOOJ YIM YOOJ YIM TSHAJ PLAWS YOOJ YIM: 4 Cov Kauj Ruam
YUAV UA LI CAS YOOJ YIM YOOJ YIM YOOJ YIM YOOJ YIM YOOJ YIM TSHAJ PLAWS: Nyob zoo txhua tus hauv cov lus qhia no kuv yuav qhia koj yuav ua li cas kom yooj yim " SOIL DRYNESS SENSOR ". Qhuav ntawm cov av tau txheeb xyuas siv qhov taw qhia coj. Lub teeb ci wi
Xuas tes Daim Npav Nyiaj so koobtsheej Xuas Tes Uas Yog Khoom Plig Rau Nws Tus Kheej!: 8 Kauj Ruam
Xuas tes Xuas Daim Npav Daim Npav Uas Yog Khoom Plig Rau Nws Tus Kheej!: Phau ntawv qhia no yuav qhia koj yuav ua li cas thiaj tsim tau daim npav tshwj xeeb, txhua tus tuaj yeem tsim los ntawm cov neeg tau txais kev pab tom qab lub caij so xaus, thiab yooj yim dua yog tias koj muab rau lawv IKEA clip duab thav duab nrog rau daim npav. Cov npav no tuaj yeem yog