Cov txheej txheem:

Siv RGB LED Los Ntawm 37 Cov Khoom Taw Qhia: 6 Cov Kauj Ruam
Siv RGB LED Los Ntawm 37 Cov Khoom Taw Qhia: 6 Cov Kauj Ruam

Video: Siv RGB LED Los Ntawm 37 Cov Khoom Taw Qhia: 6 Cov Kauj Ruam

Video: Siv RGB LED Los Ntawm 37 Cov Khoom Taw Qhia: 6 Cov Kauj Ruam
Video: Ryzen 7000 и Zen 4: на ваши вопросы отвечает Роберт Холлок из AMD 2024, Kaum ib hlis
Anonim
Siv RGB LED Los Ntawm 37 Cov Khoom Ntsuas
Siv RGB LED Los Ntawm 37 Cov Khoom Ntsuas
Siv RGB LED Los Ntawm 37 Cov Khoom Ntsuas
Siv RGB LED Los Ntawm 37 Cov Khoom Ntsuas

Yog li koj tau tawm mus thiab yuav cov khoom siv ntawm cov ntsuas hluav taws xob thiab cov qauv rau tus nqi zoo hu ua "37 Sensors" (zoo li qhov no ntawm no lossis lwm tus ntawm Amazon), tab sis tsis tuaj yeem nrhiav cov ntaub ntawv ntawm cov qauv kom siv tau? Cov lus qhia ua ntu no yuav pab koj tawm nrog txhua tus qauv hauv 37 Cov Khoom Ntsuas. Muaj lwm cov khoom siv uas muag tus lej sib txawv ntau dua 37, xws li 20 pob khoom siv, thiab 45 pob khoom siv. Cov ntsuas/cov qauv no tseem muaj los ntawm qee lub khw muag khoom online ib tus zuj zus.

Cov khoom siv no zoo heev rau STEM (Science, Technology, Engineering, thiab Mathematics) kev sim thiab kev kawm.

Cov khoos phis tawm los ntawm 37 Cov Khoom Siv Hluav Taws Xob hu ua "RGB LED" yog dhau los ntawm qhov thiab nto saum RGB LED. Nov yog LED nrog peb xim sib txawv LED suav nrog hauv ib pob.

(Cov duab thiab cov ntaub ntawv siv nrog kev tso cai los ntawm 37sensors.com)

Kauj Ruam 1: RGB LED Module Nqe lus piav qhia

LED muaj cov xim liab, ntsuab, thiab xiav, txhua tus tswj tau ntawm nws tus kheej. Qee qhov qauv muaj qhov txwv tsis pub siv tam sim no, qee qhov tsis ua.

Kuj hu ua: puv xim LED, peb xim LED, tri-chromatic LED, KY021, KY016.

Pom hauv cov khoom siv: 37 lub ntsuas pa, 45 lub ntsuas pa (hla-qhov LED).

Pom hauv cov khoom siv: 20 lub ntsuas, 37 lub ntsuas, 45 lub ntsuas (SMT LED).

Kauj Ruam 2: Kev Qhia Tshwj Xeeb RGB LED Module

RGB LED Module Specification
RGB LED Module Specification

LED: Tog TH lossis SMT 5050

Forward voltage poob liab: 2.1V

Forward voltage poob ntsuab: 3.2V

Forward voltage poob xiav: 3.2

Liab: 625nm

Ntsuab: 530nm

Xiav: 465nm

Loj: 20mm X 15mm

Qee qhov qauv muaj qhov txwv tsis pub siv tam sim no, qee qhov tsis ua. Tus nqi tiv taus raug yog 120 - 270 Ohms.

Pins feem ntau sau npe tsis raug. RGB, BGR, GRB, thiab lwm yam.

Muaj ntau qhov chaw sib txawv rau cov qauv no. Tsis yog txhua tus qauv uas zoo ib yam rau cov ntawm no coj tus yam ntxwv zoo ib yam. Txheeb xyuas qhov tshwj xeeb uas koj muaj rau qhov sib txawv hauv kev ua haujlwm, qib hluav taws xob, pinout, thiab cov xeev tsis ua haujlwm/ua haujlwm. Qee qhov qauv tau pom tias muaj cov cim npe tsis raug thiab txawm tias cov khoom siv tsis zoo.

Kauj Ruam 3: Cov Khoom Siv LED RGB

Cov Khoom Siv RGB LED Kev sim
Cov Khoom Siv RGB LED Kev sim

Tsuas yog pom cov hauv paus ntawm qhov kev ua haujlwm no ua haujlwm li cas, qhov kev sim no qhia tau tias yuav cuam tshuam nws li cas kom yooj yim-rau-nkag siab microcontroller board, Sensor. Engine: MICRO. Tsis tas yuav xav tau cov txheej txheem txhim kho nyuaj raws li 32-ntsis micro uas yog ib feem ntawm pawg thawj coj no muaj tag nrho cov ntse ua hauv.

Txoj cai rau lwm lub microcontroller platform yuav zoo ib yam lus/syntax, tab sis zoo ib yam.

Nov yog cov npe me me ntawm cov khoom siv rau qhov kev sim no:

RGB LED Module los ntawm 37 Cov Khoom Siv. (Qhov kev sim no qhov chaw: CircuitGizmos) Cov khoom siv kuj muaj nyob ntawm Amazon thiab online hauv ntau qhov chaw.

Jumper Wires, poj niam rau poj niam "DuPont" style. (Qhov kev sim no lub hauv paus: CircuitGizmos) Cov dhia dhia ntawm hom no kuj muaj nyob online.

Microcontroller Board. (Qhov kev sim no lub hauv paus: CircuitGizmos)

Lub PC nrog daim ntawv thov davhlau ya nyob twg tau siv los sib txuas lus nrog pawg thawj coj ntawm USB. Ib txoj haujlwm pub dawb thiab muaj txiaj ntsig zoo li Beagle Term.

Nrog rau txhua qhov no, koj tuaj yeem ua qhov kev sim los ntsuas RGB LED Module.

Kauj Ruam 4: RGB LED Module Sim Hookup

RGB LED Module Kev sim Hookup
RGB LED Module Kev sim Hookup

Cov xaim dub - Cov av ib txwm muaj

SEM GND - Module Av

Hlau liab - RedLED caij

SEM P4 - Qauv R

Ntsuab hlau - RedLED keeb

SEM P5 - Qauv G

Xiav xaim - RedLED keeb

SEM P6 - Qauv B

Qhov tshwj xeeb dhau los-qhov LED module muaj qhov txwv tam sim no resistor yog li tsis xav tau sab nraud resistor xav tau

Kauj Ruam 5: RGB LED Module Experiment Code

RGB LED Module Kev sim Code
RGB LED Module Kev sim Code
RGB LED Module Kev sim Code
RGB LED Module Kev sim Code

Nrog lub PC txuas nrog lub rooj tsav xwm tswj hwm microcontroller, Beagle Term yog lub qhov rais mus rau yam uas tshwm sim ntawm lub rooj tsavxwm ntawd. Koj tuaj yeem nkag mus rau txoj haujlwm program, saib cov ntawv luam tawm ntawm tus lej ntawd, thiab txawm tias cuam tshuam los ntawm kev ntaus cov ntaub ntawv mus rau hauv qhov program. Nws nyob hauv tus kws kho mob no uas koj yuav nkag mus rau txoj haujlwm program. Koj tuaj yeem txuag cov cai uas koj ntaus nrog Control-Qkeystroke. Koj tuaj yeem txuag thiab tam sim ntawd khiav cov cai uas nyob hauv tus kho nrog Tswj-W.

Tswj cov yuam sij rau txoj haujlwm EDIT ua haujlwm. (Cov yuam sij ua haujlwm tsis ua haujlwm raug hauv Beagle Term)

  • Tswj -U - Tsiv mus rau kab hauv tsev
  • Tswj -U Tswj -U-Txav mus pib qhov haujlwm
  • Tswj -K - Tsiv mus rau kab kawg
  • Tswj -K Tswj-K-Txav mus rau qhov kawg ntawm txoj haujlwm
  • Tswj -P - Nplooj ntawv nce
  • Tswj -L - Nplooj ntawv nqis
  • Tswj-] - Rho tawm
  • Tswj -N - Ntxig
  • Tswj -Q - Txuag cov cai
  • Tswj -W - Khiav cov cai
  • Tswj -R - Nrhiav
  • Tswj -G - Rov nrhiav dua
  • Tswj -T - Kos cov ntawv
  • Tswj -Y - Muab tshuaj txhuam cov ntawv
  • ESC - Tawm ntawm tus kws kho mob tso tseg kev hloov pauv.

Nkag mus rau qhov kev sim no tus lej hauv tus editor:

SETPIN 4, NTUJ

SETPIN 5, YUAV SETPIN 6, YUAV TSUM PAUSE 200: PIN (4) = 1: PAUSE 200: PIN (4) = 0 PAUSE 200: PIN (5) = 1: PAUSE 200: PIN (5) = 0 PAUSE 200: PIN (6) = 1: PAUSE 200: PIN (6) = 0 LOOP

Qhov kev xeem no teeb tsa tus pin 4, 5, thiab 6 rau cov txiaj ntsig thiab tom qab ntawd teeb tsa txhua qhov ntawm cov txiaj ntsig ntawd siab thiab qis kom tig xim xim rau thiab tawm.

r = ib

g = 1 b = 100 PWM 1, 1000, r, g, b PAUSE 5000 Ua rau r = 0 txog 99 STEP 2 PWM 1, 1000, r, g, b PAUSE 10 NEXT r PAUSE 5000 rau b = 100 rau 1 KAUJ RUAM -2 PWM 1, 1000, r, g, b PAUSE 10 NEXT b PAUSE 5000 rau g = 0 txog 99 STEP 2 PWM 1, 1000, r, g, b PAUSE 10 NEXT g PAUSE 5000 rau r = 100 rau 1 Kauj Ruam - 2 PWM 1, 1000, r, g, b PAUSE 10 NEXT r PAUSE 5000 for b = 0 to 99 STEP 2 PWM 1, 1000, r, g, b PAUSE 10 NEXT b PAUSE 5000 rau g = 100 rau 1 Kauj Ruam -2 PWM 1, 1000, r, g, b PAUSE 10 NEXT g PAUSE 5000 LOOP

Txoj cai ntsuas ntsuas no siv PWM kom maj mam nce/txo qhov tso tawm ntawm R, G, thiab B raws hauv cov qauv. Muaj 5-thib ob qeeb ntawm qhov kev hloov pauv.

PWM cov txiaj ntsig tuaj yeem ua haujlwm dhau los ntawm lub xeev ruaj khov (saib nplooj ntawv xa tawm) lossis FET kom tsav 5V lossis 12V RGB LED strips.

Kauj Ruam 6: RGB LED Module Summary/Feedback

Yog tias koj muaj cov ntaub ntawv ntxiv ntawm cov lus qhia tshwj xeeb lossis tus cwj pwm ntawm hom qauv no, thov tawm tswv yim ntawm no thiab kuv yuav suav nrog cov ntaub ntawv cuam tshuam. Yog tias koj paub txog tus qauv uas zoo sib xws, tab sis tej zaum muaj nyob ib leeg lossis hauv cov khoom sib txawv ntawm cov qauv, thov hais qhov ntawd.

Cov lus pom yuav tseem yog qhov chaw zoo kom suav nrog cov qauv me me rau lwm lub microcontroller platform yog tias koj tau sim nrog tus qauv no. lossis mus ntsib 37 Sensors thiab 37 Sensors Docs.

Pom zoo: