0% found this document useful (0 votes)
6 views3 pages

Arduino Servo Motor Control Code

The document contains an Arduino sketch that controls four servos: pinggang, tangan, lengan, and capit. It defines their positions and includes a loop that gradually moves the servos through specified angles with delays. The setup function attaches the servos to specific pins, while the loop function animates their movements in a sequence.

Uploaded by

Rifqi Arif
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views3 pages

Arduino Servo Motor Control Code

The document contains an Arduino sketch that controls four servos: pinggang, tangan, lengan, and capit. It defines their positions and includes a loop that gradually moves the servos through specified angles with delays. The setup function attaches the servos to specific pins, while the loop function animates their movements in a sequence.

Uploaded by

Rifqi Arif
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

#include <Servo.

h>

Servo pinggang;

Servo tangan;

Servo lengan;

Servo capit;

int pos1 = 0;

int pos2 = 180;

int pos3 = 100;

int pos4 = 130;

int pos5 = 180;

int pos6 = 80;

int pos7 = 150;

int pos8 = 180;

void setup()

[Link](3);

[Link](6);

[Link](9);

[Link](11);

void loop()

{
for(pos1 = 0; pos1 <= 180; pos1 += 1)

[Link](pos1);

delay(50);

for(pos8 = 180; pos8 >= 100; pos8 -= 1)

[Link](pos8);

delay(100);

for(pos2 = 180; pos2 >= 150; pos2 -= 1)

[Link](pos2);

delay(100);

for(pos4 = 130; pos4 >= 80; pos4 -= 1)

[Link](pos4);

delay(50);

for(pos5 = 180; pos5 >= 0; pos5 -= 1)

[Link](pos5);

delay(50);

}
for(pos6 = 80; pos6 <= 130; pos6 += 1)

[Link](pos6);

delay(50);

for(pos7 = 150; pos7 <= 180; pos7 += 1)

[Link](pos7);

delay(100);

for(pos3 = 100; pos3 <= 180; pos3 += 1)

[Link](pos3);

delay(100);

You might also like