Controlling a Servo With LinkIt One

Published

Introduction: Controlling a Servo With LinkIt One

About: I like to create new things! I'm very interested in IOT and just Internet Stuff. I am not responsible for any injury or deaths caused by my projects.

In this instructable we will be controlling a servo with a linkit one board the servo will turn 20 degrees per second and make 180 degree turns

Step 1: Upload Code

if you dont know how to upload the code to the LinkIt One board click here

Here is the Code I Made:

________________________________________________________________________________

/* This code is a simple code that will controll you servo with a linkit one the servo will respond with a 10 degree turn every half second then return to 0 when reaching 180*/

#include<Servo.h>

inti;

Servomyservo;


voidsetup(){

myservo.attach(9);

myservo.write(90);

}



voidloop(){

delay(500);

i+=10;

if(i==180){

i=0;}

myservo.write(i);

}


______________________________________________________________________________

Step 2: Connect Servo

Connect the servos signal wire to ~D9 and the power cables to 5v and Gnd

Step 3: Run Your Code

The servo should move as stated in the into

Step 4: Need Help?

Feel free to contact me here

Share

    Recommendations

    • Casting Contest

      Casting Contest
    • Microcontroller Contest

      Microcontroller Contest
    • Woodworking Contest

      Woodworking Contest
    user

    We have a be nice policy.
    Please be positive and constructive.

    Tips

    Questions

    3 Comments

    Nice simple Instructable and well written too. I see you received some stickers also! Yay Instructables and Seeed Studios for the LinkIt Ones!