EX11
EX11
11
SERVO MOTOR CONTROL WITH ARDUINO
AIM :
HARDWARE REQUIREMENTS:
PROCEDURE:
Servo motor wires:
1.Red color wire is always positive
2.brown color is negative which is
ground.
3. orange color is the signal pin which we need to connect to the digital pin of the
arduino
4. connect orange color pin to 9th pin in arduino board.
5. import the servo library file into the arduino uno
software
6.Run the code, the servo motor will be shifting from 0 degree to 180 degree as given in
the code.
CIRCUIT DIAGRAM :
CODE:
#include<Servo.h>
Servo s1;
Void setup()
{
S1.attach(9);
}
Void loop()
{
S1.write(0);
Delay(1000);
S1.write(180);
delay(1000);
s1.write(0);
}
RESULT: