Cov txheej txheem:

Ib Tus Menyuam Nrhiav Menyuam Yaus: 3 Kauj Ruam
Ib Tus Menyuam Nrhiav Menyuam Yaus: 3 Kauj Ruam

Video: Ib Tus Menyuam Nrhiav Menyuam Yaus: 3 Kauj Ruam

Video: Ib Tus Menyuam Nrhiav Menyuam Yaus: 3 Kauj Ruam
Video: Plab Plab Ntswg..(Pluav Pluav Ntswg) Maiv Twm New Song 2023-2024 2024, Hlis ntuj nqeg
Anonim
Image
Image
Ib Tus Menyuam Tshawb Nrhiav Tus Menyuam
Ib Tus Menyuam Tshawb Nrhiav Tus Menyuam

Muaj ib hnub kuv pom cov vis dis aus nthuav tawm ntawm: https://arduinotr.com/cisim/?fbclid=IwAR22rYmiRQQJ0nqAusOLhBj_778gROseej6TUonvbOnAd65A-sl_wnyqrJQ&tdsourcetag=s_pcqq_aiomsg qhov no yog qhov yeeb yaj kiab zoo, tab sis cheating

Thaum xub thawj siab ib muag kuv xav tias nws coj txawv txawv, thiab tom qab ntawd ko taw dag, tsis paub dab tsi yog qhov laj thawj hauv qab rau tus tsim qauv no tau ua dab neeg yuam kev ….

Kuv tsis paub tus txiv leej tub thiab tag nrho zaj dab neeg, Kuv tsuas yog sim ua los ntawm kuv tus kheej. Kuv tsuas yog tsim kuv tus kheej tsim, nrog cov qauv yooj yim heev:

  • Ib qho Arduino sib xws xws li Maduino
  • L298N tsav tsheb
  • 3 x IR sensor
  • Qee qhov dhia dhia

Kauj Ruam 1: Kev Pom Teeb Meem

Kev Pom Teeb Meem
Kev Pom Teeb Meem

Muaj 3 lub ntsuas hluav taws xob IR tau siv los txhawm rau txheeb xyuas qhov teeb meem, thiab sab laug/sab xis pom qhov teeb meem, nws yuav tsum tig mus rau lub moos/tiv thaiv lub moos, thaum qhov ntsuas nruab nrab pom, nws yog qhov yog.

Lub 3 sensor pom yog tias muaj teeb meem nyob rau pem hauv ntej. Txuas lub teeb liab tus pin rau Maduino tus pin, xws li Pin2/3/4;

Raws li software, yooj yim txheeb xyuas qhov xwm txheej ntawm lub sensor, los txiav txim siab lub cav yuav tsum ua dab tsi:

yog tias (IR1_STA == HIGH & IR2_STA == LOW & IR3_STA == HIGH) // Yog tias tus middlesensor pom qhov teeb meem, lub cav nres

{

analogWrite (EN, 0);

Nres ();

}

yog tias (IR1_STA == LOW & IR2_STA == HIGH & IR3_STA == HIGH) // yog tias lub sensor ncaj ncees pom lub cev tsis muaj zog, lub cev rov qab nrog kev nrawm;

{

analogWrite (EN, siab tshaj);

Rov qab ();

}

yog (IR1_STA == LOW & IR2_STA == LOW & IR3_STA == HIGH) // yog

txoj cai & nruab nrab qhov ntsuas pom qhov tsis xwm yeem, lub cev rov qab nrog qis qis;

{

analogWrite (EN, lowspeed);

Rov qab ();

}

……

Kauj Ruam 2: Tswj Lub Cev

Kev Tswj Lub Cev
Kev Tswj Lub Cev
Kev Tswj Lub Cev
Kev Tswj Lub Cev

Thiab tus tsav tsheb kom tsav lub cav, nrog siab/qis nrawm, nyob ntawm qhov xwm txheej ntsuas.

Siv tus lej L298N los tsav lub cav, nrog Maduino pin5/6, thiab PWM tus pin (Maduino Pin9) rau L298N Pab kom tus pin, thiab siv lub zog nrog 9V:

EN EN = 9; // PWM control

int highspeed = 80; // txhais lub siab ceev

int lowspeed = 60; // txhais qhov qis qis

thiab tom qab ntawd lub cev muaj zog tuaj yeem tswj tau los ntawm:

analogWrite (EN, siab tshaj);

Kauj Ruam 3: Txhim Kho Ib Yam Muaj, Xws Li Aub …

Nruab Ib Yam Muaj, Xws Li Aub …
Nruab Ib Yam Muaj, Xws Li Aub …

Nruab cov ntsuas thiab lub tshuab, thiab ua ib yam dab tsi rau, rau kuv, Kuv nyiam aub ua si nrog kuv tus ntxhais hnub nyoog 1.5 xyoos. Donwload tus lej Arduino ntawm no….of dawb hu rau kuv: [email protected] yog tias muaj lus nug

Pom zoo: