jehankandt
Published © Apache-2.0

Arduino with Servo motor

How to use Servo motor with Arduino

IntermediateFull instructions provided313
Arduino with Servo motor

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Jumper wires (generic)
Jumper wires (generic)
×1
SG90 Micro-servo motor
SG90 Micro-servo motor
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Arduino with Servo motor

Arduino with Servo motor

Code

Arduino with Servo motor

C/C++
Arduino with Servo motor
//...............JehanKandy........................
//........www.jehankandy.com.......................
//........www.github.com/JehanKandy................

//.......................Motors....................
//.................Servo Motor Basic...............

//in here you should include Servo.h lib..
#include <Servo.h>

//define servo motor
Servo motor1;



void setup() {
  //define pins for Servo Motors
  motor1.attach(2);  

}

void loop() {
  //in here you can give value form 0 to 180(0 -> 180)
  
  motor1.write(30); 
  delay(1000);
  motor1.write(30);
  delay(1000);

}

//.........coded by : JehanKandy....
//...........Thank You..............

Credits

jehankandt
21 projects • 8 followers
Contact

Comments

Please log in or sign up to comment.