Cov txheej txheem:

SERVO MOTOR - KOB - ARDUINO - CODE REVEAL #2: 4 Kauj Ruam
SERVO MOTOR - KOB - ARDUINO - CODE REVEAL #2: 4 Kauj Ruam

Video: SERVO MOTOR - KOB - ARDUINO - CODE REVEAL #2: 4 Kauj Ruam

Video: SERVO MOTOR - KOB - ARDUINO - CODE REVEAL #2: 4 Kauj Ruam
Video: How to Make PLC LCD HMI || FLProg 2024, Hlis ntuj nqeg
Anonim
SERVO MOTOR - KOB - ARDUINO - CODE REVEAL #2
SERVO MOTOR - KOB - ARDUINO - CODE REVEAL #2
SERVO MOTOR - KOB - ARDUINO - CODE REVEAL #2
SERVO MOTOR - KOB - ARDUINO - CODE REVEAL #2

KNOB: Tswj txoj haujlwm ntawm RC (nyiam ua haujlwm) servo motor nrog koj Arduino thiab lub zog ntsuas. Qhov piv txwv no ua rau siv Arduino servo library.

Kauj ruam 1: HARDWARE YUAV TSUM:

HARDWARE YUAV TSUM
HARDWARE YUAV TSUM

Arduino lossis Genuino Board, Servo Motor, 10k ohm potentiometer, Hook-up (Jumper) xov hlau.

Kauj Ruam 2: CIRCUIT:

CIRCUIT
CIRCUIT

Servo motors muaj peb lub xov hlau: fais fab, av, thiab teeb liab. Cov xaim hluav taws xob feem ntau yog xim liab, thiab yuav tsum txuas nrog 5V tus pin ntawm Arduino lossis Genuino board. Cov xov hlau hauv av feem ntau yog xim dub lossis xim av thiab yuav tsum txuas nrog tus pin hauv av ntawm lub rooj tsavxwm. Lub teeb liab tus pin feem ntau yog xim daj lossis txiv kab ntxwv thiab yuav tsum txuas nrog tus pin 9 ntawm lub rooj tsav xwm. P potentiometer yuav tsum tau xaim kom nws ob lub pins sab nraud txuas nrog lub zog (+5V) thiab hauv av, thiab nws tus pin nruab nrab txuas nrog cov lus sib piv 0 ntawm board.

Kauj ruam 3: CODE:

CODE
CODE

#suav nrog Servo myservo; int potpin = 0; int val; void teeb () {myservo.attach (9);} void loop () {val = analogRead (potpin); val = daim ntawv qhia (val, 0, 1023, 0, 180); myservo.write (nqi); ncua (15);}

Kauj Ruam 4: QHIA INSTAGRAM POST:

Mus ntsib kuv qhov Instagram tshaj tawm. Txheeb nws, txoj haujlwm no tseem tau piav qhia nyob ntawd -

Pom zoo: