Instantly share code, notes, and snippets.

Embed
What would you like to do?
Mini Servo sg90
#include <Servo.h>
#define SERVO_PIN 9
Servo myServo;
byte i;
void setup()
{
Serial.begin(57600);
myServo.attach(SERVO_PIN);
}
void loop()
{
while (Serial.available() > 0) {
i = Serial.read();
myServo.write(i);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment