Introduction: Servo Motor With LinkitONE

Picture of Servo Motor With LinkitONE

Hello friends do you know about basic electronics. Have you ever heard about link it one...With it we can create those short of electronic things which we can only think about...Working with link it one makes it really easy to fulfil our dreams and bring it into action in front of the entire world.....Today I am going to present a small view of the project which can be done using a link it one as compare to those great project which can be done using it....

To rotate the servo motor on pressing the switch.
Note :- Servo motor is a type of geared motor that can only rotate 180 degrees. It is controlled by sending electrical pulses from your board. These pulses tell the motor what position it should move to.
Switch or pushbutton is momentary switches that close a circuit when pressed. They snap into breadboard easily. These are good for detecting on / off signals.

Step 1: Tools Required

Picture of Tools Required

- Servo motor

- Jumpers

- LinkitONE

- Button

Step 2: Programming

#include //it is a header file for servo motor
Servo servol;
int switchstate=0;
void setup()
{
pinMode(5,OUTPUT); //it defines the digital pin 5 as output
servol.attach(9); //it defines the digital pin 9 as output
}
void loop()
{
switchstate=digitalRead(5); //digitalRead checks the chosen pin 5 for voltage
if(switchstate==LOW) //it is a conditional statement
{
servol.write(1); //it commands the servo motor to set its position to 1 degree
}
if(switchstate==HIGH)
{
servol.write(179); //it commands the servo motor to set its position to 179 degree
}
delay(2000); //it calls a delay for 2 seconds
}

Step 3: Connecting - Switch

Picture of Connecting - Switch

Step 1
Take a link it one and connect it with your laptop.
Step 2
Take a breadboard and place a switch on it.
Step 3
Connect the digital pin 5 with one end of the switch and ground it with the same side.

Step 4: Connecting - Servo

Picture of Connecting - Servo

Step 4
Connect it from the 5 volt pin with the other side.
Step 5
Connect one end of the servo motor with the 5 volt.
Step 6
Connect its other end with the ground.
Step 7
Connect the digital pin 9 to the middle pin of the servo motor.

Step 5: Try It

Picture of Try It

Now try it out....

This project may develop a feeling of interest for LinkitONE inside you. Through this program you will be able to understand the basic use of LinkitONE clearly and will make you capable of handling it.
You will be able to understand the basic use of LinkitONE with the descriptions given above.

Comments

pauldash29 (author)2015-12-23

I is it a relative of arduino?Is it hard to get the code for Linkin one

About This Instructable

2,963views

19favorites

License:

More by ayushagg:Servo Motor with LinkitONELinkitONE MP3 PlayerLinkitONE LED Pattern Generation
Add instructable to: