Cov txheej txheem:

LED Tswj: 6 Kauj Ruam
LED Tswj: 6 Kauj Ruam

Video: LED Tswj: 6 Kauj Ruam

Video: LED Tswj: 6 Kauj Ruam
Video: Tswv Yexus lub neej thaum pib txug thaum xaus 2024, Hlis ntuj nqeg
Anonim
LED Tswj
LED Tswj

Qhov haujlwm no yog ib feem ntawm kuv qhov kawg rau CSCI 1200.

Txoj haujlwm no muaj 5 LEDs thiab lub zog ntsuas hluav taws xob. Tsiv lub hwj chim hloov pauv ntawm cov LEDs thiab ploj cov LEDs uas nyob ib sab ntawm LED tam sim no.

Kauj Ruam 1: Npaj Arduino Npaj

Npaj Arduino Npaj
Npaj Arduino Npaj

Rau qhov haujlwm no, koj yuav xav tau:

  • Arduino Ib
  • Cov qhob cij
  • Jumper Hlau
  • 5 x lwd
  • 5x 220Ω Cov neeg tiv thaiv
  • Potentiometer

Kauj Ruam 2: Txuas Fais Fab rau Breadboard

Txuas lub zog rau Breadboard
Txuas lub zog rau Breadboard

Txuas tus 5v fais fab tus pin ntawm Arduino mus rau txoj kev tsheb nqaj hlau ntawm lub khob cij. Txuas tus pin hauv av ntawm Arduino mus rau txoj kev tsheb nqaj hlau ntawm lub khob cij.

Kauj Ruam 3: Txuas Thawj LED

Txuas Thawj LED
Txuas Thawj LED

Ntxiv thawj LED mus rau lub khob cij thiab txuas cov cathode rau hauv av tsheb nqaj hlau. Txuas 220Ω resistor rau anode ceg ntawm LED thiab txuas nws rau tus pin 3 ntawm Arduino.

Kauj Ruam 4: Ntxiv qhov seem ntawm LEDs

Ntxiv qhov seem ntawm LEDs
Ntxiv qhov seem ntawm LEDs

Txuas tus so ntawm LEDs mus rau lub khob cij ib yam nkaus li thawj tus.

Ua raws cov txheej txheem hauv qab no kom pom tus pin txhua tus LED mus rau.

LED 1: 3

LED 2: 6

LED 3: 9

LED 4: 10

LED 5: 11

Kauj Ruam 5: Ntxiv Potentiometer

Ntxiv Potentiometer
Ntxiv Potentiometer

Muab lub hwj chim ntsuas hluav taws xob tso rau ntawm lub khob cij thiab txuas ib qho ntawm cov ceg hauv qab mus rau txoj kev tsheb nqaj hlau thiab lwm qhov txuas mus rau txoj kab hluav taws xob ntawm lub khob cij. Txuas sab saum toj ceg rau tus pin A5 ntawm Arduino.

Kauj Ruam 6: Tshaj Tawm Txoj Cai

Tshaj tawm cov cai rau Arduino thiab nws yuav pib ua haujlwm. Tig lub hwjchim ntsuas kom hloov qhov LED tau xaiv thiab qhov nyob ib puag ncig ntawd LED yuav ploj mus.

Pom zoo: