Cov txheej txheem:

Nyeem ADC Qhov Muaj Peev Xwm Los Ntawm Potentiometers: 4 Kauj Ruam
Nyeem ADC Qhov Muaj Peev Xwm Los Ntawm Potentiometers: 4 Kauj Ruam

Video: Nyeem ADC Qhov Muaj Peev Xwm Los Ntawm Potentiometers: 4 Kauj Ruam

Video: Nyeem ADC Qhov Muaj Peev Xwm Los Ntawm Potentiometers: 4 Kauj Ruam
Video: The Hmong Ghost Movie part 3 (ADC Production) 2024, Hlis ntuj nqeg
Anonim
Nyeem ADC Qhov Muaj Peev Xwm Los Ntawm Potentiometers
Nyeem ADC Qhov Muaj Peev Xwm Los Ntawm Potentiometers

Hauv kab lus no kuv yuav qhia koj yuav ua li cas nyeem ADC qhov tseem ceeb los ntawm lub zog ntsuas.

qhov no yog lub hauv paus ntawm Arduino programming. uas yog nyeem qhov sib piv siv tus lej Analog muab los ntawm Arduino.

dua li siv lub zog, muaj ntau lub ntsuas cua uas siv cov tswv yim analog. xws li lub teeb pom kev zoo, lub suab suab thiab cov av noo noo.

Vim li cas siv lub lauj kaub? vim tias cov khoom siv no yooj yim nrhiav thiab tuaj yeem sawv cev rau cov ntsuas uas tau nyeem siv cov tswv yim analog.

Los ntawm ADC nyeem ntawv no, tom qab ntawv nws tuaj yeem koom tes nrog cov khoom tsim tawm. thiab yeej yuav tsim yam ntxim nyiam.

Kauj Ruam 1: Cov Cheeb Tsam Xav Tau

Yuav tsum tau Cheebtsam
Yuav tsum tau Cheebtsam
Yuav tsum tau Cheebtsam
Yuav tsum tau Cheebtsam
Yuav tsum tau Cheebtsam
Yuav tsum tau Cheebtsam
Yuav tsum tau Cheebtsam
Yuav tsum tau Cheebtsam

Nov yog ib feem uas xav tau hauv phau ntawv qhia no:

  • Arduino nano v3.0
  • Lub zog 100K
  • Jumper Hlau
  • Pawg Thawj Coj
  • USB mini tso
  • Laptop
  • Arduino IDE Cov

Kauj ruam 2: Sib sau ua ke

Sib sau ua ke
Sib sau ua ke

Sib sau tag nrho cov khoom siv.

Siv cov duab kos duab saum toj no los ua cov lus qhia rau kev sib dhos nws.

Potentio rau Arduino

1 ==> GnP

2 ==> UA0

3 ==> 5V

Kauj ruam 3: Programming

Programming
Programming

Tom qab lub Circuit Court raug teeb tsa. Tom ntej no, sau arduino nrog ADC nyeem cov haujlwm uas tau ua.

Daim duab uas kuv tau ua yog ntxaws li no:

void teeb () {// initialize serial communication ntawm 9600 ntsis ib ob: Serial.begin (9600); }

// lub voj kev ua haujlwm dhau mus thiab ntau dua ib si:

void loop () {// nyeem cov tswv yim ntawm analog pin 0: int sensorValue = analogRead (A0); // luam tawm tus nqi koj nyeem: Serial.println (sensorValue); ncua (1); // ncua nyob nruab nrab ntawm kev nyeem rau kev ruaj ntseg}

Koj tseem tuaj yeem rub tawm thawj daim ntawv hauv qab no:

Kauj Ruam 4: Qhov tshwm sim

Qhov tshwm sim
Qhov tshwm sim

Cov hauv qab no yog ib txoj hauv kev pom cov txiaj ntsig:

  • Qhib cov ntawv saib ntawm Arduino.
  • Nco ntsoov tias tus nqi baud ntawm tus lej saib thiab qhov kev zov me nyuam tsim nyog (ntawm no siv 9600).
  • ces tig lub hwj chim
  • Thaum tig mus rau sab xis, ADC tus nqi yuav ntau dua
  • Thaum tig sab laug, ADC tus nqi yuav tau me dua
  • Tus nqi me tshaj yog 0 thiab tus nqi loj tshaj yog 1023.

Los ntawm cov ntaub ntawv digital 0-1023, peb tuaj yeem siv nws los ua lwm yam ntxim nyiam. Tsuas yog saib kuv kab lus tom ntej.

Pom zoo: