Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
SHIVENDRA VATSA MISHRA
Published

Operating Servo Motor Through Arduino On Online Simulator

Tinkercad is the largest community of 3D design enthusiasts of its kind! It is an online simulator on which projects can be made.

BeginnerShowcase (no instructions)1 hour20,808
Operating Servo Motor Through Arduino On Online Simulator

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Servo Motor
×1

Software apps and online services

Arduino IDE
Arduino IDE
Tinkercad
Autodesk Tinkercad

Hand tools and fabrication machines

Jumper wires

Story

Read more

Custom parts and enclosures

Circuit Diagram Through Eagle

Schematics

ci_qxT9nA9Yjq.JPG

Code

servo_code.ino

C/C++
#include <Servo.h>

int pos = 0;

Servo servo_9;

void setup()
{
  servo_9.attach(9);

}

void loop()
{
  // sweep the servo from 0 to 180 degrees in steps
  // of 1 degrees
  for (pos = 0; pos <= 180; pos += 1) {
    // tell servo to go to position in variable 'pos'
    servo_9.write(pos);
    // wait 15 ms for servo to reach the position
    delay(15); // Wait for 15 millisecond(s)
  }
  for (pos = 180; pos >= 0; pos -= 1) {
    // tell servo to go to position in variable 'pos'
    servo_9.write(pos);
    // wait 15 ms for servo to reach the position
    delay(15); // Wait for 15 millisecond(s)
  }
}

Credits

SHIVENDRA VATSA MISHRA
5 projects • 17 followers
Parsuing B.Tech from SRM Institute Of Science And Technology in Electrical And Electronics Engineering.
Contact

Comments

Please log in or sign up to comment.