Cov txheej txheem:
- Kauj ruam 1: Txuas Micro Servo
- Kauj Ruam 2: Xeem Micro Servo
- Kauj Ruam 3: Txuas lub Potentiometer
- Kauj Ruam 4: Potentiometer Starter Code
- Kauj Ruam 5: Txuas Thawj LED
- Kauj Ruam 6: Txuas Txuas Kab Ntawm LEDs
- Kauj Ruam 7: Ntxiv Thawj LED, Kab Ob
- Kauj Ruam 8: Txuas LEDs kawg
- Kauj Ruam 9: Tswj LED Zaub
Video: Micro Servo Lab: 9 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:29
Hauv chav kuaj no peb yuav ua haujlwm ntawm kev tswj hwm micro servo txoj haujlwm nrog lub zog ntsuas. Raws li txoj haujlwm ntawm micro servo's "caj npab" peb yuav ua kom pom cov kab sib xws ntawm LEDs. Rau qhov lab no koj yuav xav tau:
- 1 micro servo (ib qho muab yog 9 gram micro servo)
- 1 potentiometer
- 10 LEDS (siv ob xim sib txawv)
- 10 220 Ohm resistors
Kauj ruam 1: Txuas Micro Servo
Lub micro servo muaj peb lub xov hlau rau lub zog, hauv av, thiab teeb liab mem tes. Lub micro servo yuav lees txais PWM mem tes los txiav txim seb nws yuav tsum nyob hauv txoj haujlwm (0 - 180 degrees). Txuj ci koj tuaj yeem siv ib qho ntawm PWM pins ntawm Arduino Uno, tab sis feem ntau peb pib nrog Pin 9 lossis 10*.
Teeb:
- Txuas lub khob cij rau lub tsheb ciav hlau (+5V) thiab tsheb nqaj hlau hauv av (GND)
- Txuas cov servo mus rau txoj kev tsheb nqaj hlau, tsheb nqaj hlau, thiab Pin 9.
** Qhov no yog vim lub Tsev qiv ntawv Servo siv Timer2 ntawm Arduino uas yuav thaiv peb los ntawm kev siv PWM cov cim, analogWrite (), ntawm ob tus pin rau lwm lub hom phiaj tom qab ntawd tswj lub servo. Thaum peb tseem tuaj yeem siv cov pins no rau digital i/o, peb feem ntau yuav siv cov no tshwj xeeb rau kev tswj hwm servo **
Kauj Ruam 2: Xeem Micro Servo
Cov cai ntawm no yog tus qauv piv txwv muab los ntawm Servo Library. Nws yuav tsuas yog muaj servo cheb rov qab los ntawm 0 txog 180 degrees
/* Qhib
los ntawm BARRAGAN Cov piv txwv piv txwv no yog nyob hauv zej tsoom. hloov kho 8 Nov 2013 los ntawm Scott Fitzgerald https://www.arduino.cc/en/Tutorial/Sweep */#include "Servo.h" Servo myservo; // tsim cov khoom siv servo los tswj hwm servo // kaum ob cov khoom siv servo tuaj yeem tsim ntawm feem ntau cov laug cam int pos = 0; // sib txawv los khaws qhov chaw ua haujlwm servo void teeb () {myservo.attach (9); // txuas cov servo ntawm tus pin 9 rau cov khoom siv servo} void loop () {rau (pos = 0; 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 15ms rau servo kom mus txog txoj haujlwm}}
Kauj Ruam 3: Txuas lub Potentiometer
Tam sim no peb yuav ua haujlwm ntawm kev tswj tus kheej ntawm txoj haujlwm ntawm servo nrog lub zog ntsuas. Txuas lub potentiometer raws li hauv qab no:
- Sab laug - Tsheb nqaj hlau
- Sab xis - Lub zog tsheb nqaj hlau
- Sab saum toj/Nruab nrab kev txuas - Tus pin A0 (analog 0 tus pin)
Kauj Ruam 4: Potentiometer Starter Code
Hauv qab no yog qee qhov pib rau kev tswj hwm servo nrog lub zog ntsuas. Ua kom tiav cov cai kom thaum koj txav lub hwj chim, lub servo yuav txav mus los ua ke.
/* 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 */#include "Servo.h" Servo myservo; // tsim cov khoom siv servo los tswj hwm servo // kaum ob cov khoom siv servo tuaj yeem tsim ntawm feem ntau cov laug cam int pos = 0; // sib txawv los khaws qhov chaw servo int potPin = 0; // Xaiv tus pin rau txuas lub potentiometer int potVal = 0; // Tam sim no tus nqi potentiometer tsis muaj teeb tsa teeb tsa () {myservo.attach (9); // txuas cov servo ntawm tus pin 9 rau cov khoom siv servo pinMode (potPin, INPUT); } void loop () {potVal = analogRead (potPin); myservo.write (pos); // qhia servo mus rau txoj haujlwm hauv qhov sib txawv 'pos' ncua (15); // tos 15ms rau servo kom mus txog txoj haujlwm}
Kauj Ruam 5: Txuas Thawj LED
Tom qab peb muaj servo tswj ntawm lub hwj chim, peb yuav ntxiv qee cov lus tawm tswv yim ntawm qee qhov LEDs. Peb yuav tsim ob kab ntawm LEDs. Ib tus yuav sawv cev rau "sab laug" caj npab ntawm servo thiab lwm tus yuav sawv cev rau "sab xis" caj npab ntawm servo. Raws li servo hloov txoj haujlwm, ib txhais caj npab yuav sawv thiab lwm tus yuav poob. Cov LEDs yuav ci kom pom:
- tag nrho - caj npab tau tsa
- ib nrab - caj npab yog vaj huam sib luag.
- tawm - caj npab qis dua
Daim duab yuav tso saib kab ntawm LEDs ntawm qhov kawg ntawm daim ntawv qhia zaub mov. Qhov no tau ua kom yooj yim ntawm kev pom kev, koj cov LED yuav tsum tau kab/txawm nrog ib leeg.
Txuas thawj LED:
- Txuas qhov luv luv ntawm LED mus rau txoj kev tsheb nqaj hlau
- Txuas qhov ntev ntawm LED mus rau 220 Ohm resistor. Txuas tus tiv thaiv rau tus pin 13 ntawm Arduino.
Kauj Ruam 6: Txuas Txuas Kab Ntawm LEDs
Tom qab thawj LED tau ntxiv, txuas cov LEDs ntxiv:
- Cov hlau lead luv dua - txuas rau cov tsheb nqaj hlau hauv av
- Ntev dua - txuas 220 Ohm resistor rau LEDs thiab cov Arduino Pins hauv qab no: 12, 11, 10, 9, 8
Kauj Ruam 7: Ntxiv Thawj LED, Kab Ob
Cov kab thib ob ntawm LEDs yuav raug ntxiv nyob rau hauv tib yam li thawj:
- Txuas qhov luv luv ntawm LED mus rau txoj kev tsheb nqaj hlau
- Txuas qhov ntev ntawm LED mus rau 220 Ohm resistor. Txuas tus tiv thaiv rau tus pin 7 ntawm Arduino.
Kauj Ruam 8: Txuas LEDs kawg
Txuas cov LEDs ntxiv:
Cov hlau lead luv dua - txuas mus rau hauv av tsheb ciav hlau Ntev dua - txuas 220 Ohm resistor rau LEDs thiab cov Arduino Pins hauv qab no: 6, 5, 4, 3
Kauj Ruam 9: Tswj LED Zaub
Koj cov kauj ruam kawg yog hloov kho koj cov cai los tswj koj cov LEDs. Nws yuav tsum tau ua raws li cov hauv qab no:
- Cov kab saum toj kawg nkaus yuav phim "sab tes xis" ntawm qhov kev pabcuam. Raws li caj npab sweeps nce/nqis LEDs yuav tsum qhib/tua.
- Cov kab hauv qab yuav phim "sab caj npab sab laug" ntawm qhov kev pabcuam. Raws li caj npab sweeps nce/nqis LEDs yuav tsum qhib/tua.
Pom zoo:
Arduino Tsheb Rov Qab Chaw Nres Tsheb Ceeb Toom - Cov Kauj Ruam ntawm Kauj Ruam: 4 Kauj Ruam
Arduino Tsheb Rov Qab Chaw Nres Tsheb Ceeb Toom | Cov kauj ruam ib kauj ruam: Hauv txoj haujlwm no, kuv yuav tsim qhov yooj yim Arduino Tsheb Rov Qab Tsheb Nres Tsheb Nres Sensor Siv Arduino UNO thiab HC-SR04 Ultrasonic Sensor. Qhov no Arduino raws Lub Tsheb Rov Qab ceeb toom tuaj yeem siv rau Kev Tshawb Fawb Txog Tus Kheej, Robot Ranging thiab lwm yam
Tsev Automation Kauj Ruam ntawm Kauj Ruam Siv Wemos D1 Mini Nrog PCB Tsim: 4 Kauj Ruam
Tsev Automation Kauj Ruam Ib Leeg Siv Wemos D1 Mini Nrog PCB Tsim: Tsev Automation Kauj Ruam los ntawm Kauj Ruam siv Wemos D1 Mini nrog PCB Tsim cov tub ntxhais kawm ntawv qib siab. Tom qab ntawd ib tus ntawm peb cov tswv cuab tuaj
RC Taug Qab Neeg Hlau Siv Arduino - Kauj Ruam Ib kauj ruam: 3 Kauj Ruam
RC Tracked Robot Siv Arduino - Kauj Ruam Ib Nrab: Hav guys, Kuv rov qab los nrog lwm tus neeg hlau txias chassis los ntawm BangGood. Vam tias koj tau dhau los ntawm peb cov phiaj xwm yav dhau los - Spinel Crux V1 - Tus Cwj Pwm Tswj Tus Neeg Hlau, Spinel Crux L2 - Arduino Xaiv thiab Muab Neeg Hlau nrog Robotic caj npab thiab Badland Braw
Kawm Yuav Ua Li Cas Kos Tus Tswm Ciab - Kauj Ruam Ib Kauj Ruam: 6 Kauj Ruam
Kawm Yuav Ua Li Cas Thiaj Li Tswmciab - Kauj Ruam Ib kauj ruam: Cov tswm ciab no siv sijhawm 10 feeb los kos yog tias koj ua raws kuv cov kauj ruam ua tib zoo
DIY Arduino Robotic Arm, Kauj Ruam ntawm Kauj Ruam: 9 Kauj Ruam
DIY Arduino Robotic Arm, Kauj Ruam ntawm Kauj Ruam: Cov ntawv qhia no yog qhia koj yuav tsim lub Caj Npab Caj Npab ntawm koj tus kheej li cas