Skip to content

Instantly share code, notes, and snippets.

@AbhishekGhosh
Created November 3, 2015 05:06
Servo Motor Arduino (Basic)
int servopin = 4;
int pulse = 1500;
void setup ()
{
pinMode(servopin, OUTPUT);
Serial.begin(9600);
}
void loop()
{
digitalWrite(servopin, HIGH);
delayMicroseconds(pulse);
digitalWrite(servopin, LOW);
delay(20);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment