Tutorial

Arduino Uno

Contact us at any time

Door No.510
Samastha jubilee memorial soudham
Mele-thampanoor
Thiruvananthapuram
Kerala-695001
Ph:+91 9633 11 80 80
Email:info@hexcodeplus.com

Enquire and suggestions

Whatsapp +91 9633 11 80 80

Arduino interface with Servo Motor

Let's study how to interface servo motor (model : SG 90) with arduino uno

Sg-90 Servo Motor Pins

Arduino connection



Arduino Program

#include <Servo.h>
Servo servo;

int i = 0;

void setup()
{
  servo.attach(9);
}

void loop()
{
  for (i = 0; i <= 180; i++)
  {
    servo.write(i);
    delay(15);
  }
  
  for (i = 180; i >= 0; i--)
  {
    servo.write(i);
    delay(15);
  }
}

open arduino New page and upload this code


Follow us

Tutorials / Code