Cov txheej txheem:

Arduino Debounce Yooj Yim: 4 Kauj Ruam
Arduino Debounce Yooj Yim: 4 Kauj Ruam

Video: Arduino Debounce Yooj Yim: 4 Kauj Ruam

Video: Arduino Debounce Yooj Yim: 4 Kauj Ruam
Video: Arduino Button Debounce Tutorial 2024, Hlis ntuj nqeg
Anonim
Arduino Yooj Yim Debounce
Arduino Yooj Yim Debounce

Cov lus qhia no yog hais txog yuav ua li cas thiaj yooj yim debounce nrog 2 cov nyees khawm. Txhua yam koj xav tau yog kev paub yooj yim hauv tshuab hluav taws xob thiab kev tsim khoom arduino.

Yees duab:

www.youtube.com/embed/Iw6rA0cduWg

Yog tias koj muaj lus nug lossis teeb meem koj tuaj yeem tiv tauj kuv ntawm kuv tus email: [email protected]

Yog li cia pib.

Kauj ruam 1: Cov ntaub ntawv

Khoom siv
Khoom siv

Txhua yam koj xav tau rau txoj haujlwm no koj tuaj yeem tau txais ntawm UTSource.net

Sponsor Link: UTSource.netReviews

Nws yog lub vev xaib ntseeg tau rau kev xaj cov khoom siv hluav taws xob nrog tus nqi pheej yig thiab zoo tshaj

Koj xav tau:

-2 laub khawm

-Arduino Mega 2560 lossis Uno

-Breadboard

-Qee cov xov hlau

-2 LED (ntsuab thiab liab) yog tias koj xav tau koj tuaj yeem xaiv lwm yam xim

-two 10k ohm resistors

-thiab ntawm chav kawm computer.

Kauj ruam 2: Saib Video

Koj tseem tuaj yeem pom tias txoj haujlwm no ua haujlwm li cas

www.youtube.com/watch?v=Iw6rA0cduWg

Kauj Ruam 3: Kev thaiv kab hlau

Thaiv
Thaiv
Thaiv
Thaiv
Thaiv
Thaiv

Txoj haujlwm no yooj yim heev rau kev txuas vim tias tsis muaj cov khoom siv hluav taws xob ntau.

-push khawm (ON) txuas nrog tus lej digital 2

-push khawm (OFF) txuas nrog tus lej digital 3

-green LED txuas nrog digital pin 5

-lub LED txuas nrog tus lej digital 4

Koj tsuas yog yuav tsum tau ceev faj tias koj txuas 10k ohm resistors ntawm GND thiab thawb khawm tus pin. (Saib daim duab Circuit)

Kauj ruam 4: Code

Txoj cai no yooj yim heev los ua thiab nkag siab.

Nws ua haujlwm zoo li ntawd.

-Thaum koj ntaus ON lub laub khawm, hloov pauv x lub xeev hloov mus rau 1, nyob ntawd kom txog thaum koj ntaus lub pob OFF thiab ntsuab LED qhib.

-Thaum koj ntaus OFF khawm laub, hloov pauv x lub xeev hloov rov qab mus rau 0, nyob ntawd kom txog thaum koj ntaus ON khawm dua thiab liab LED tig rau.

Tsuas yog rub nws, ntsaws rau hauv Arduino thiab xa cov lej.

Pom zoo: