DIYmall 9G Servo with Arduino UNO R3 Tutorial

Servo control generally requires a base pulse about 20MS,if the degree is not 180 degree, you need adjust the base pulse in the Arduino code

0.5ms—0 degree
1.0ms—45 degree
1.5ms-—90 degree
2.0ms — 135 degree
2.5ms— 180 degree

Below is Arduino code:

 

#include <Servo.h>

Servo servo1;

 

void setup()

{

servo1.attach(3);

 

servo1.writeMicroseconds(2500); // = -90°

delay(500);

servo1.writeMicroseconds(500); // = 0°

delay(500);

servo1.writeMicroseconds(1500); // = 90°

delay(500);

servo1.writeMicroseconds(2500); // = -90°

delay(500);

servo1.writeMicroseconds(500); // = 0°

delay(500);

servo1.writeMicroseconds(1500); // = 90°

delay(500);

}

void loop() {}

 

 

Test result video links:

sweep from left to right:  https://youtu.be/arjDG0e88Bs

From left to middle then to right:  https://youtu.be/LZMyuq_Ohn0

You can buy it from amazon

amazon US https://www.amazon.com/dp/B074SH8XRK

amazon Germany https://www.amazon.de/dp/B076FY9FYK

email  sales@diymalls.com

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *