Cov txheej txheem:

Khiav a Servo Nrog Chibitronics Chibi Clip: 5 Kauj Ruam
Khiav a Servo Nrog Chibitronics Chibi Clip: 5 Kauj Ruam

Video: Khiav a Servo Nrog Chibitronics Chibi Clip: 5 Kauj Ruam

Video: Khiav a Servo Nrog Chibitronics Chibi Clip: 5 Kauj Ruam
Video: KHIAV TSOV ROG NYAB LAJ 1975 Hmong Cartoon Animation 2024, Hlis ntuj nqeg
Anonim
Khiav Servo Nrog Chibitronics Chibi Clip
Khiav Servo Nrog Chibitronics Chibi Clip
  • Chibitronics Chibi Clip
  • Cable uas tuaj nrog daim clip
  • 3 jumper xov
  • micro servo tsav
  • (tsis teb los tau) tus nab kuab clip

Kauj ruam 1: Txuas Chibi Clip rau lub khoos phis tawj

Txuas Chibi Clip rau lub khoos phis tawj
Txuas Chibi Clip rau lub khoos phis tawj

Txuas Chibi Clip rau hauv koj lub computer. Tsis txhob hnov qab ntsaws rau hauv ob lub USB cable thiab lub mloog pob ntseg nkaus. Chibi Clip rub lub zog los ntawm USB, thiab tau txais koj cov haujlwm los ntawm lub mloog pob ntseg.

Kauj Ruam 2: Txuas Koj Cov Hluav Taws Xob Jumper rau Koj Lub Cev Tsav Tsheb

Txuas koj Cov Hluav Taws Xob Jumper rau Koj Lub Cev Tsav Tsheb
Txuas koj Cov Hluav Taws Xob Jumper rau Koj Lub Cev Tsav Tsheb

Feem ntau cov servo motors tuaj nrog lub qhov (socket) kawg, yog li koj yuav tsum tau txuas cov xov hlau txuas rau qhov no kom koj tuaj yeem ntxig qhov kawg ntawm cov xov hlau txuas rau hauv Chibi Clip.

Cov xim ntawm cov xov hlau uas koj siv tsis muaj teeb meem, tab sis kom khaws cov khoom kom huv si, peb tau txuas cov hlua txuas txuas nrog cov xim

Kauj Ruam 3: Txuas Lub Tsav Tsheb mus rau Chibi Clip

Txuas lub Tsav rau Chibi Clip
Txuas lub Tsav rau Chibi Clip
Txuas lub Tsav rau Chibi Clip
Txuas lub Tsav rau Chibi Clip

Lub cev muaj peb lub xov hlau: liab yog "lub zog", dawb (qee lub cav siv daj) yog "teeb liab", thiab dub yog "hauv av". Peb yuav txuas lawv mus rau ntu sib xws ntawm Chibi clip.

Muaj ntau txoj hauv kev sib txawv los ua lub cev txuas cov xov hlau rau daim clip. Qhov tseem ceeb yog kom ntseeg tau tias cov xov hlau nyob hauv kev sib cuag nrog cov ntsiab lus sib txuas ntawm daim clip.

Txuas cov xaim dub mus rau GND ib feem ntawm daim clip; dawb (lossis daj) mus rau "0", thiab liab mus rau +5V ntawm sab xis saum toj ntawm daim clip. Nws yog qhov nyuaj los khaws cov hlau liab hauv kev sib cuag, yog li koj tuaj yeem siv tus kais dej clip los tsim kev sib txuas zoo dua.

Kauj Ruam 4: Upload Code rau Koj Chibi Clip

Upload Code rau Koj Chibi Clip
Upload Code rau Koj Chibi Clip

Tam sim no peb yuav tsum tso qee cov cai rau Chibi Clip.

Mus rau:

Tam sim no, nyem rau ntawm "Piv txwv" khawm, xaiv Actuators -> Servo Sweep.

Cov cai yuav tsum zoo li cov cai hauv daim duab no.

Txoj cai no ua dab tsi?

Yog tias koj tshiab rau coding lossis Arduino, qhov no yuav zoo li tsis meej pem me ntsis. Thawj qhov yog tso qhov no rau koj Chibi Clip kom pom nws ua dab tsi. Yog tias koj tsis tau siv Chibi Chip, ua tibzoo saib ntawm no.

Thaum koj ua tiav xa cov cai, koj yuav tsum pom servo tig rov qab.

/* Sweep los ntawm BARRAGAN Qhov piv txwv piv txwv no yog nyob rau pej xeem.

hloov kho 8 Nov 2013 los ntawm Scott Fitzgerald https://www.arduino.cc/en/Tutorial/Sweep */

#suav nrog

Servo tswj; // tsim cov khoom siv servo los tswj lub servo

int pos = 0; // sib txawv los khaws txoj haujlwm servo

void teeb tsa () {

myservo.attach (0); // txuas cov servo ntawm tus pin 0 rau cov khoom siv servo

}

void voj () {

rau (pos = 0; pos <= 180; pos += 1) {// mus los ntawm 0 degrees txog 180 degrees // hauv cov theem ntawm 1 degree myservo.write (pos); // qhia servo mus rau txoj haujlwm hauv qhov sib txawv 'pos'

ncua (15); // tos 15 ms (milliseconds) rau servo kom mus txog txoj haujlwm

}

rau (pos = 180; pos> = 0; pos -= 1) {// mus ntawm 180 degrees mus rau 0 degrees

myservo.write (pos); // qhia servo mus rau txoj haujlwm hauv qhov sib txawv 'pos'

ncua (15); // tos 15 ms rau servo kom mus txog txoj haujlwm

}

}

Pom zoo: