Cov txheej txheem:

Lub thawv tom: 4 Kauj ruam
Lub thawv tom: 4 Kauj ruam

Video: Lub thawv tom: 4 Kauj ruam

Video: Lub thawv tom: 4 Kauj ruam
Video: Kauj vab kauj le _(1 tsug 13 hnub part #9)_ Phees lauj Ft Maiv xis fullmusic Mv 2023 2024, Hlis ntuj nqeg
Anonim
Lub thawv tom
Lub thawv tom

Yuav tsum:

1. 11 xov hlau (4 liab, 4 txiv kab ntxwv/daj, 3 dub)

2. 1 khawm

3. 10 ohm resistor

4.2 servo motors

5. Thawv nrog lub hau txav tau

6. Thawv nrog lub hau ruaj ntseg (kom tshem koj cov arduino thiab xov hlau)

7. Cov ntaub

8. Cov khoom siv txuas

Kauj Ruam 1: Kauj Ruam 1: Breadboard

Kauj ruam 1: Breadboard
Kauj ruam 1: Breadboard
Kauj ruam 1: Breadboard
Kauj ruam 1: Breadboard

Khawm:

1. Txuas cov hlau daj rau tus pin 8

2. Txuas cov hlau liab rau 3.3V

3. Txuas cov xaim dub rau GND

Kev pab:

1. Txuas cov xov dub servo rau -

2. Txuas cov xov liab liab rau +

3. Ua liab + kab hlau txuas rau Vin

4. Muaj kab kab kab kab kab kab txuas rau GND

Kauj ruam 2: Code

Code
Code

Base code coj los ntawm:

Txoj cai kho kom tau txais cov nyhuv tom thiab txhawb nqa ob lub cav servo

#suav nrog;

const int buttonPin = 8;

const int servoPin = 9; Servo tsav 1;

const int servoPin2 = 11; Servo tsav 2;

const int delayBite = 300;

teeb tsa tsis muaj dab tsi () {servo1.attach (servoPin); servo2.attach (servoPin2);

pinMode (buttonPin, INPUT); }

void voj () {

int buttonState;

buttonState = digitalRead (buttonPin);

yog (buttonState == LOW) {servo1.write (150); servo2.write (90); ncua (delayBite); servo1.write (90); servo2.write (150); ncua (delayBite); servo1.write (150); servo2.write (90); ncua (delayBite); servo1.write (90); servo2.write (150); ncua (delayBite); servo1.write (150); servo2.write (90); ncua (delayBite); servo1.write (90); servo2.write (150); }}

Kauj Ruam 3: Nkaum Koj Cov Xov Tooj

Nkaum Koj Cov Xov Tooj
Nkaum Koj Cov Xov Tooj

Txhawm rau zais qhov ua haujlwm sab hauv ntawm koj qhov kev nyab xeeb, koj tuaj yeem tuav txhua hom ntim, tsuav koj tuaj yeem ua qhov hauv nws. Kuv tau mus nrog lub ntim Hummus qub, ua li ntawd lub hau tau yooj yim tshem tawm thiab kuv tuaj yeem txiav los ntawm cov yas. Kuv txuas kuv lub hauv siab me me rau lub hau ntawm lub ntim nrog qee cov ntsia hlau, thaum npog tag nrho lub khob ntim nrog cov ntaub, muab nws zoo dua. txoj kev, yog li kuv xav kom siv lwm txoj hauv kev yog tias koj paub ib qho.

Cov servo motors tawm mus los ntawm lub qhov nyob tom qab ntawm lub ntim, thaum lub zog siv los ntawm sab.

Yog lawm, yog tias koj xav siv qhov chaw tsawg dua thiab khaws koj cov khoom tsim hauv ib qho, nco ntsoov muab koj cov xov hlau tso rau es tsis txhob siv lub khob cij!

Kauj Ruam 4: Cov Ntawv Txuas Ntxiv

Cov ntawv txuas zaum kawg
Cov ntawv txuas zaum kawg
Cov ntawv txuas zaum kawg
Cov ntawv txuas zaum kawg

Tom qab ua kom ntseeg tau tias kev ua haujlwm sab hauv ntawm koj txoj haujlwm yog qhov raug, nws yog lub sijhawm los ua nws tag nrho ua ke!

Nco ntsoov muab cov kua nplaum tso rau sab nraub qaum ntawm koj lub hauv siab ruaj khov. Rau qhov txav ntawm lub hauv siab Kuv txuas qee cov laug cam rau cov servo motors thiab lub hauv siab, vim kuv lub cav tsis ntev txaus los kov lub hauv siab. uas tsis ua haujlwm rau koj txawm hais tias, koj ib txwm tuaj yeem sim cov khoom sib txawv, tsuas yog ua kom ntseeg tau tias cov kev txav mus los zoo ib yam ua ntej txuas rau nws.

Pom zoo: