Introduction: Controlling a Servo With LinkIt One

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

Comments

author

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

author
DIY Hacks and How Tos (author)2015-10-18

Great LinkIt One tutorial!

author

Thanks

About This Instructable

160views

5favorites

License:

Bio: 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 ... More »
More by Funguypro:3D Print Your House!!!!!DIY Raspberry Pi Indoor Outdoor WebcamSee Through Buildings With a Drone
Add instructable to: