Cov txheej txheem:
- Kauj Ruam 1: Sib Sau Ua Ke Txhua Yam Koj Yuav Tsum Muaj Rau Txoj Haujlwm no
- Kauj Ruam 2: Nkag Siab Li Cas Ob Txhais Tes ntawm RGB LED Ua
- Kauj Ruam 3: Ntxig rau 330 Ohm Resistors thiab Ground Jumper Cable rau hauv Breadboard
- Kauj Ruam 4: Ntxiv LED rau Peb Lub Circuit Court
- Kauj Ruam 5: Txuas Cables rau Breadboard Tshooj 1: Txuas Hauv av
- Kauj Ruam 6: Txuas Cov Cables rau Breadboard Ntu 2: Txuas Txuas Liab LED Taw
- Kauj Ruam 7: Txuas Cables mus rau Breadboard Ntu 3: Txuas Ntsuab LED Taw
- Kauj Ruam 8: Txuas Cables rau Breadboard Tshooj 4: Txuas Blue LED Leg
- Kauj Ruam 9: Lub cajmeem hauv Kos: Txheeb Xyuas Circuit
- Kauj ruam 10: Programming hauv Kos: Kuv Yuav Ua Li Cas Nrog RGB LED
- Kauj Ruam 11: Txheeb Screen ntawm Scratch Program
Video: Hloov ib qho RGB LED Los Ntawm Cov Xim Spectrum Siv Raspberry Pi 2 thiab Kos: 11 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:27
Hloov Kho Cov Lus Sau Hnub Tim 25 Lub Ob Hlis, 2016: Kuv tau txhim kho Scratch program thiab rov tsim kho kuv cov lus qhia.
Nyob zoo cov neeg, nrog txoj haujlwm no kuv xav siv Kos rau lub voj voog RGB LED los ntawm cov xim xim.
Muaj ntau qhov haujlwm ua qhov no nrog Arduino, yog li kuv xav paub seb kuv puas tuaj yeem tau txais qhov txiaj ntsig zoo nrog Raspberry Pi.
Kuv thawj zaug sim ntawm qhov kev qhia no tsis zoo heev, yog li kuv tau tshawb fawb me ntsis ntxiv thiab xav tias kuv muaj qee yam uas ua haujlwm tau zoo dua. Thaum kuv tab tom saib xyuas qee qhov haujlwm Arduino txhawm rau nkag siab qhov twg kuv mus yuam kev hauv kuv qhov haujlwm qub, kuv dawm qhov ntawv Arduino zoo heev, uas kuv yuav txuas koj mus rau qhov kawg. Kuv tus phooj ywg Andrew thiab kuv tau siv sijhawm tav su los hloov nws mus rau Kos. Peb tau ua peb qhov zoo tshaj plaws nrog nws thiab kuv vam tias koj yuav sim nws.
Txoj haujlwm no yog ua raws los ntawm kuv cov lus qhia txog kev hloov pauv qhov ci ci ntawm LED siv cov nyees khawm thiab kos uas koj tuaj yeem pom ntawm no:
www.instructables.com/id/PWM-Based-LED-Cont…
Txuas mus rau thawj Arduino Sketch Kuv raws kuv qhov kev pab cuam Kos rau ntawm:
www.arduino.cc/en/Tutorial/DimmingLEDs tus sau Clay Shirky
Kauj Ruam 1: Sib Sau Ua Ke Txhua Yam Koj Yuav Tsum Muaj Rau Txoj Haujlwm no
Cov khoom koj yuav xav tau:
Raspberry Pi nrog Raspian operating system thiab internet txuas
1 x Breadboard
1 x RGB LED (nquag cathode)
3 x 330 ohm resistors (txiv kab ntxwv txiv kab ntxwv xim av)
4 x txiv neej/poj niam breadboard cables
1 x txiv neej/txiv neej breadboard cable (lossis me me ib leeg tub ntxhais jumper cable yog tias koj muaj)
Kauj Ruam 2: Nkag Siab Li Cas Ob Txhais Tes ntawm RGB LED Ua
Coj koj RGB LED thiab saib ntawm ob txhais ceg, koj yuav pom tias ib txhais ceg ntev dua txhua qhov. Taw qhia cov LED kom cov ceg ntev tshaj plaws no nyob rau sab laug.
Pin 1 yog siv los ua LED ci RED
Pin 2 yog tus pin hauv av
Tus Pin 3 ua rau LED ci GREEN
Tus Pin 4 ua rau LED ci BLUE
RGB LED Kuv tab tom siv muaj cov cathode ib txwm, uas txhais tau tias koj txuas nws cov ceg hauv av rau Raspberry Pi hauv av pin kom nws ua haujlwm.
Kauj Ruam 3: Ntxig rau 330 Ohm Resistors thiab Ground Jumper Cable rau hauv Breadboard
Txhawm rau ua kom yooj yim pom ntawm daim duab peb tuaj yeem tso cov resistors thiab cov kab hauv av uas lawv xav tau ua ntej. Resistors tsis muaj polarity yog li nws tsis muaj teeb meem dab tsi puag ncig lawv mus.
Nco tseg: Vim li cas peb thiaj xav tau peb tus tiv thaiv rau ib qho LED?
Xav txog RGB LED ua 3 qhov sib txawv LEDs tau ntim rau hauv ib qho. Yog tias peb muaj 3 tus tib neeg LEDs hauv Circuit peb yuav siv tus tiv thaiv rau txhua tus, thiab yog li peb xav tau tus tiv thaiv rau txhua ceg xim ntawm RGB LED.
Kauj Ruam 4: Ntxiv LED rau Peb Lub Circuit Court
Tam sim no peb muaj cov tiv thaiv thiab cov kab hauv av nyob hauv qhov chaw, peb tuaj yeem txhim kho peb cov LED rau hauv daim phiaj ci ci. Taw qhia LED yog li cov ceg ntev tshaj plaws yog sab laug.
Maj mam muab ob txhais ceg me ntsis tso cai rau lawv ntsaws rau hauv lub khob cij, ua kom ntseeg tau tias txhua ceg yog nyob rau tib txoj kab raws li tus tiv thaiv sib xws.
Cov ceg ntev tshaj plaws (ceg 2) yuav tsum ua kab nrog cov kab hauv av dub.
Kauj Ruam 5: Txuas Cables rau Breadboard Tshooj 1: Txuas Hauv av
Ua ntej no peb txuas hauv av los ntawm Raspberry Pi mus rau hauv av ceg ntawm LED.
Hauv kuv daim duab kuv tau txuas tus txiv neej/poj niam cable los ntawm tus pin 6 ntawm Raspberry GPIO mus rau hauv av tsheb nqaj hlau ntawm lub khob cij los txuas LED lub hauv paus ceg mus rau Raspberry Pi.
Daim npav siv qhia koj tus pin teeb tsa rau Raspberry Pi GPIO. 40 tus pin GPIO rau sab xis ntawm daim duab yog rau Raspberry Pi 2, uas kuv siv los ua txoj haujlwm no.
Kauj Ruam 6: Txuas Cov Cables rau Breadboard Ntu 2: Txuas Txuas Liab LED Taw
Thawb tus txiv neej kawg ntawm txoj hlua mus rau hauv lub qhov tsuas yog siab dua tus tiv thaiv ntawm sab laug, thiab thawb tus poj niam kawg ntawm txoj hlua mus rau GPIO17 (pin11) ntawm Raspberry Pi.
Daim npav siv rau tus pin GPIO yuav pab coj koj mus rau tus pin raug.
Kauj Ruam 7: Txuas Cables mus rau Breadboard Ntu 3: Txuas Ntsuab LED Taw
Thawb tus txiv neej kawg ntawm txoj hlua mus rau hauv lub qhov tsuas yog siab dua tus tiv thaiv nyob hauv nruab nrab, thiab thawb tus poj niam kawg ntawm txoj hlua mus rau GPIO18 (pin12) ntawm Raspberry Pi.
Daim npav siv rau tus pin GPIO yuav pab coj koj mus rau tus pin raug.
Kauj Ruam 8: Txuas Cables rau Breadboard Tshooj 4: Txuas Blue LED Leg
Thawb tus txiv neej kawg ntawm txoj hlua mus rau hauv lub qhov tsuas yog siab dua tus tiv thaiv ntawm sab xis, thiab thawb tus poj niam kawg ntawm txoj hlua mus rau GPIO27 (pin13) ntawm Raspberry Pi.
Daim npav siv rau tus pin GPIO yuav pab coj koj mus rau tus pin raug.
Kauj Ruam 9: Lub cajmeem hauv Kos: Txheeb Xyuas Circuit
Thaum kuv thawj zaug teeb tsa txoj haujlwm no kuv tau ua tsis zoo me me thiab sib xyaw kuv cov xim xim, uas txhais tau tias thaum kuv xav kom liab tuaj, ntsuab tuaj ntxiv, yog li kuv tau sau qhov program yooj yim los txheeb xyuas tias txhua yam tau txuas nrog kom raug.
Kev ntsuas LED yog tswj los ntawm 3 khub tus yuam sij
A thiab Z tswj RED, A hloov liab rau, Z hloov liab liab
S thiab X tswj GREEN, S hloov ntsuab rau, X hloov ntsuab tawm
D thiab C tswj BLUE, D hloov xiav rau, C hloov xiav tawm
Teeb tus pin kom siab ua rau lub teeb ci LED, teeb tsa nws kom qis hloov LED tawm.
Rub tawm qhov program thiab ntsuas koj lub Circuit yog tias koj xav kom ntseeg tau tias nws tau txuas nrog kom raug.
Kauj ruam 10: Programming hauv Kos: Kuv Yuav Ua Li Cas Nrog RGB LED
Kev ua haujlwm hauv kos yog qhov kev paub zoo. Nws muaj qhov nyem thiab luag interface thiab zoo nkauj heev. Txawm hais tias nws tau tsim thawj zaug los qhia rau menyuam yaus rau kev ua haujlwm kuv yeej xav tias nws yog qhov chaw zoo tsim muaj txiaj ntsig ib puag ncig raws li kuv xav tau qhia hauv cov cai uas tswj hwm LED hauv kuv txoj haujlwm.
Yog li ntawm no yog qhov kuv xav kom tshwm sim:
Kev hloov xim yuav ua tiav hauv peb theem:
Hauv thawj theem peb pib nrog liab ntawm qhov siab tshaj plaws thiab ntsuab thiab xiav teeb mus rau qib me me.
Peb tom qab ntawd pib txo qis lub teeb liab los ntawm -1, thaum nce ntsuab ci ntawm 1.
Peb siv lub voj voos ntsuas kom txwv pes tsawg zaus qhov no tshwm sim.
Thaum lub voj ntsuas tau mus txog 255 peb pib theem thib ob.
Hauv theem thib ob ntsuab yuav yog qhov siab tshaj plaws, liab thiab xiav teeb rau qib qis.
Peb txo qhov ci ci ntsuab los ntawm -1 thaum ua kom lub ntsej muag ci ntsa iab los ntawm 1.
Peb lub voj voj rau theem thib ob tau teeb tsa rau 509.
Thaum nws mus txog 509 peb yuav pib theem 3.
Hauv theem peb, xiav yog qhov ci tshaj plaws thiab ntsuab thiab liab yog nyob qis.
Peb pib qis qis ci ci los ntawm -1 thaum nce lub teeb liab los ntawm 1.
Thaum lub voj ntsuas mus txog 763, lub voj voog yuav pib dua ntawm theem 1.
Peb muaj peb qhov sib txawv redVal, greenVal thiab blueVal los tuav qhov tseem ceeb ntawm txhua xim qib ci ntsa iab thiab cov txiaj ntsig no tom qab ntawd xa tawm mus rau qhov tseeb GPIO pins rau lub zog rau ob txhais ceg ntawm LEDs los teeb tsa txhua qhov xim qhov ci ci, uas nyob rau hauv lem muab rau peb xim sib tov peb xav tau.
Thiab qhov ntawd yog kuv qhov kev sim hla dhau cov xim siv lub RGB LED thiab kos.
Yog tias koj muaj Arduino thiab koj tau siv daim duab kos kuv txuas uas tau tshoov kuv siab kom sau Scratch version, koj yuav pom tias tsis muaj xim flickering txhua. Kuv tsis paub tseeb vim li cas Scratch version flickers ntau heev. Kuv xav tias Arduino zoo dua ntawm kev tuav PWM, tab sis yog tias koj pom qee yam hauv kuv cov cai uas xav tau txhim kho, Kuv yuav zoo siab heev yog tias koj siv sijhawm los qhia rau kuv.
Ua tsaug rau koj nyeem kuv cov ntawv qhia thiab kuv vam tias koj muaj hnub zoo!
Kauj Ruam 11: Txheeb Screen ntawm Scratch Program
Yog tias koj xav kom muaj kev mus ntawm lub cajmeem nws tus kheej ntawm no yog saib ze ntawm cov txheej txheem.
Pom zoo:
Cov Hais Lus Ua Los Ntawm Cov Khoom Siv Rov Los thiab Rov Siv Dua: 6 Cov Kauj Ruam
Cov Hais Lus Ua Los Ntawm Cov Khoom Siv Rov Los thiab Rov Los Siv Rov Los: " Suab paj nruag yog cov lus thoob ntiaj teb ntawm tib neeg. Thiab qhov zoo tshaj plaws-lawv tsis tau them kuv ib dime. Txhua yam nyob rau hauv no pr
Tuchless Hloov rau Cov Khoom Siv Hauv Tsev -- Tswj Koj Cov Khoom Siv Hauv Tsev Tsis Muaj Tuch Ib qho Hloov: 4 Cov Kauj Ruam
Tuchless Hloov rau Cov Khoom Siv Hauv Tsev || Tswj Koj Cov Khoom Siv Hauv Tsev Tsis Muaj Tuch Ib qho Hloov: Nov Yog Qhov Tuchless Hloov Rau Cov Khoom Siv Hauv Tsev. Koj Siv Tau Qhov No Mus Rau Txhua Qhov Chaw Hauv Pej Xeem Kom Pab Tau Tawm Tsam Ib Yam Kab Mob. Lub Circuit Court Raws Li Tsaus Sensor Circuit Ua Los Ntawm Op-Amp Thiab LDR. Qhov Tseem Ceeb Thib Ob Ntawm Qhov Circuit Court SR Flip-Flop Nrog Sequencell
Arduino Neeg Hlau Nrog Kev Nyob, Kev Qhia thiab Qib Kev Sib Hloov (Sab Hnub Poob, Sab Hnub Poob, Sab Qaum Teb, Sab Qab Teb) Tswj los ntawm Lub Suab Siv Bluetooth Module thiab Kev Siv Tus Neeg Siv Hluav Taws Xob: 6 Kauj Ruam
Arduino Neeg Hlau Nrog Kev Nyob, Kev Qhia thiab Qib Kev Sib Hloov (Sab Hnub Poob, Sab Hnub Poob, Sab Qaum Teb, Sab Qab Teb) Tswj los ntawm Lub Suab Siv Bluetooth Module thiab Kev Siv Tus Neeg Siv Hluav Taws Xob: Cov lus qhia no piav qhia yuav ua li cas thiaj tsim tau Arduino Robot uas tuaj yeem txav mus raws qhov xav tau (Forward, Backward) , Sab laug, Txoj Cai, Sab Hnub Poob, Sab Hnub Poob, Sab Qaum Teb, Sab Qab Teb) xav tau Kev nrug deb hauv Centimeters siv lub suab hais kom ua. Neeg hlau kuj tseem tuaj yeem txav tau tus kheej
Yuav Siv Xim Li Cas Txhuam Txhuam Txhuam Txhuam Txhuam Txhuam Txhuam Txhuam Txhuam Txhuam Dej thiab Dej los Kos Duab ntawm Xov Tooj lossis Xov Tooj Ntawm Tes: 4 Kauj Ruam
Yuav Ua Li Cas Siv Xim Txhuam Txhuam Txhuam Txhuam Txhuam Txhuam Txhuam Txhuam Txhuam Txhuam Txhuam Dej thiab Dej rau Kos Duab ntawm Xov Tooj lossis Xov Tooj Ntawm Tes: Kev pleev xim nrog txhuam yog kev lom zem. Nws nqa nrog nws ntau lwm yam kev txhim kho rau cov menyuam
Cov Xim Ntau Yam Xim Stencils Nrog Cov Hloov Pauv Hloov: 12 Cov Kauj Ruam (nrog Duab)
Comprehensive Multi Color Stencils With Variable Output: Multilayer xim tiag tiag stenciling tsis yog txhua qhov sai thiab yooj yim. Tseeb, koj tuaj yeem crank ib zaug hauv ib teev, tab sis nws siv sijhawm thiab xyaum ua kom muaj peev xwm rov ua cov txheej txheem thiab paub yuav ua li cas txhawm rau nws rau txhua qhov sib txawv stencil. Hauv cov lus qhia no, Kuv yuav