Code: Using Servo motor

// Orange wire to Pin  9
// Red wire to 5V
// Brown to Ground

#include <Servo.h>
 
Servo myservo;

void setup()
{
  myservo.attach(9); 
}
 
void loop()
{
  myservo.write(1); 
  delay(1000);
  myservo.write(179); 
  delay(1000);  
}

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.