Cov txheej txheem:

LED Tswj Nrog Potentiometer - Kawg Xeem: 3 Kauj Ruam
LED Tswj Nrog Potentiometer - Kawg Xeem: 3 Kauj Ruam

Video: LED Tswj Nrog Potentiometer - Kawg Xeem: 3 Kauj Ruam

Video: LED Tswj Nrog Potentiometer - Kawg Xeem: 3 Kauj Ruam
Video: Varying brightness of LED using PWM on Rpi 2024, Hlis ntuj nqeg
Anonim
LED Tswj Nrog Potentiometer - FinalExam
LED Tswj Nrog Potentiometer - FinalExam

Rau kuv Qhov Kev Xeem Kawg Kawg, Kuv tsim tus tswj LED siv lub zog ntsuas. Lub hom phiaj ntawm txoj haujlwm no yog siv lub zog ntsuas los tswj cov LEDs uas nyob. Thaum lub hwj chim ntsuas hluav taws xob tig mus rau lub moos, nws ua rau cov LEDs ploj mus kom thawj LED tau ci tshaj plaws, qhov thib ob yog dimmer me ntsis, qhov thib peb tsis tshua pom, thiab qhov thib plaub thiab thib tsib raug tshem tawm tag nrho.

Nov yog cov npe ntawm cov khoom siv:

  • LEDs (x5) - Kuv siv 5 xim sib txawv.
  • 220 Ohm Resistors (x5)
  • Jumper Hlau (x10)
  • Arduino Ib
  • Cov qhob cij

Kauj Ruam 1: Ntxiv cov LEDs

Ntxiv cov LEDs
Ntxiv cov LEDs

Nov yog qhov uas kuv tau ntxiv cov LEDs rau ntawm lub khob cij thiab tom qab ntawd mus rau Arduino. Kuv siv 5 xim sib txawv rau LEDs rau kev zoo nkauj.

1. Ua ntej, txuas cov LEDs mus rau lub khob cij.

2. Txuas qhov luv luv ntawm LEDs rau hauv av tsheb nqaj hlau.

3. Txuas qhov ntev mus rau Arduino siv 220 (ohm) Resistors.

4. Txuas cov LEDs rau tus pin 13, 12, 11, 10, thiab 9 ntawm Arduino.

5. Siv lub jumper hlau, txuas cov tsheb nqaj hlau hauv av mus rau GND ntawm Arduino.

Kauj Ruam 2: Ntxiv Potentiometer

Ntxiv Potentiometer
Ntxiv Potentiometer

Nov yog qhov kuv txuas lub hwj chim rau Arduino.

1. Muab lub potentiometer tso rau ntawm lub khob cij.

2. Txuas tus pin sab laug ntawm lub hwjchim mus rau Txoj Kev tsheb nqaj hlau ntawm lub khob cij.

3. Txuas tus pin sab xis ntawm lub hwj chim rau hauv txoj kev tsheb nqaj hlau ntawm lub khob cij.

4. Txuas tus pin nruab nrab nruab nrab mus rau A5 Analog chaw nres nkoj ntawm Arduino.

5. Siv lub jumper hlau, txuas Cov Hluav Taws Xob mus rau 5V chaw nres nkoj ntawm Arduino.

Kauj ruam 3: Upload Code

Nov yog cov cai uas yuav ua haujlwm qhov program. Rub nws mus rau Arduino Uno thiab txaus siab rau!

Pom zoo: