Cov txheej txheem:

LED Circuit (TinkerCad): 3 Kauj Ruam
LED Circuit (TinkerCad): 3 Kauj Ruam

Video: LED Circuit (TinkerCad): 3 Kauj Ruam

Video: LED Circuit (TinkerCad): 3 Kauj Ruam
Video: Simple LED / Resistor Circuit Using a Breadboard and Simple Tinkercad Circuits. 2024, Kaum ib hlis
Anonim
LED Circuit (TinkerCad)
LED Circuit (TinkerCad)

Qhov haujlwm no yog kev lom zem, thiab kuv tau ua qhov no rau kuv tus kheej. Lub ntsiab lus ntawm txoj haujlwm no yog hloov pauv lub teeb ci ntau npaum li cas los ntawm tus kws yees duab. Hauv txoj haujlwm no, koj yuav xav tau 2 tus tiv thaiv, tus kws yees duab, lub teeb ci LED, Arduino Uno R3, thiab xov hlau. Txoj haujlwm no nyob ntawm Tinkercad, yog li koj yuav tsis tas yuav cov cuab yeej no.

Kauj Ruam 1: Kauj Ruam 1: Tsim Circuit Court

Kauj ruam 1: Tsim Circuit Court
Kauj ruam 1: Tsim Circuit Court

Ua ntej tshaj, koj yuav luam daim duab saum toj no. Koj yuav tau txais Arduino Uno R3 thiab yuav teeb nws qhov chaw ntawm qhov screen. Tom ntej no, koj yuav tau txais lub teeb ci LED thiab Txuas Tus Tiv Thaiv rau Cathode ntawm LED. Tom qab ntawd, koj yuav teeb tsa cov xaim uas txuas nrog Tus Tiv Thaiv ntawm LED, thiab txuas nws mus rau GND ntawm AUR3 (Arduino Uno R3). Koj yuav ua tib yam rau Anode, thiab yuav txuas cov hlau los ntawm nws mus rau D9 qhov ntawm AUR3. Nyob rau theem tom ntej, koj yuav ntxiv photoresistor thiab ntxiv lwm tus tiv thaiv, thiab tom qab ntawd txuas mus rau Terminal 1 ntawm tus photoresistor. Tom ntej no, koj yuav txuas tus tiv thaiv rau GND nrog xaim, uas pom ntawm AUR3. Nyob rau theem kawg ntawm kev tsim nws, koj yuav txuas A0 ntawm AUR3, thiab txuas nws mus rau lub davhlau ya nyob twg 1, pom ntawm tus photoresistor. Thaum kawg, koj yuav txuas xov hlau los ntawm 5v, thiab txuas nws mus rau lub dav hlau 2 ntawm tus photoresistor.

Kauj Ruam 2: Kauj Ruam 2: Code Nrog Thaiv

Kauj ruam 2: Code Nrog Blocks
Kauj ruam 2: Code Nrog Blocks

Nyem rau ntawm Pawg Variables hauv tus kho qhov chaws.

Txhawm rau khaws qhov tsis kam ntawm tus photoresistor, tsim qhov sib txawv hu ua "sensorValue". Luag tawm ib qho "set" block. Peb yuav khaws lub xeev ntawm peb tus photoresistor hauv qhov sib txawv sensorValue. Nyem rau ntawm qeb nkag thiab rub tawm qhov "analog read pin" block, thiab muab tso rau hauv "teeb" thaiv tom qab lo lus "rau" Txij li thaum peb lub zog ntsuas tau txuas nrog Arduino ntawm tus pin A0, hloov qhov poob mus rau A0. Nyem rau ntu Output thiab rub tawm ib qho "luam rau serial monitor" thaiv. Nkag mus rau qeb sib txawv thiab rub koj qhov sib txawv sensorValue mus rau "luam tawm mus rau tus saib xyuas ib ntus", thiab xyuas kom tseeb tias qhov poob qis tau teeb tsa los luam nrog kab tshiab. Optionally pib qhov simulation thiab qhib lub ntsuas saib xyuas kom paub tseeb tias kev nyeem tau nkag los thiab hloov pauv thaum koj kho lub ntsuas. Analog input qhov tseem ceeb ntawm 0-1023. Txij li thaum peb xav sau mus rau LED nrog tus lej nruab nrab ntawm 0 (tawm) thiab 255 (puv ci ci), peb yuav siv "daim ntawv qhia" thaiv ua qee qhov hla kev sib npaug rau peb. Nkag mus rau qeb lej thiab rub tawm "daim duab qhia chaw" thaiv. Hauv thawj qhov, rub hauv lub sensorValue qhov sib txawv ntawm qhov thaiv, tom qab ntawd teeb tsa qhov ntau los ntawm 0 txog 255. Rov qab rau hauv Pawg Tawm Tsam, rub tawm qhov analog "teeb tus pin" thaiv, uas los ntawm lub neej ntawd hais tias "teeb tus pin 3 rau 0." Kho nws kom teeb tus pin 9. Rub daim duab qhia chaw uas koj tau ua yav dhau los rau hauv "teeb tus pin" thaiv "rau" teb kom sau tus lej hloov pauv rau tus pin LED siv PWM. Nyem rau Pawg tswj hwm thiab rub tawm qhov tos tos, thiab kho nws kom ncua txoj haujlwm rau.1 vib nas this.

Kauj Ruam 3: Kauj Ruam 3: Sim Nws

Kauj Ruam 3: Sim Nws!
Kauj Ruam 3: Sim Nws!

Tam sim no koj tau kawm nyeem tus kws yees duab thiab qhia nws cov zis kom tswj tau qhov ci ntawm LED, koj npaj tau los siv cov ntawd thiab lwm yam txuj ci uas koj tau kawm txog tam sim no. Txoj haujlwm no tsis nyuaj li, thiab tsuas yog coj kuv li 3 hnub los ua. Ua tsaug!

Pom zoo: