#include <Servo.h>

Servo myservo;  

int pos = 0;    

void setup() {
  myservo.attach(0);  
  pinMode(1, OUTPUT);
  pinMode(3, OUTPUT);

}

void loop() {
  for (pos = 0; pos <= 180; pos += 1) { 
    myservo.write(pos);              
    delay(15);                      
  }
  digitalWrite(1, HIGH);   
  delay(15);                       

  digitalWrite(2, LOW);   


  for (pos = 180; pos >= 0; pos -= 1) { 
    myservo.write(pos);              
    delay(15);                      
  }
  digitalWrite(2, HIGH);   
  delay(15);                       

  digitalWrite(1, LOW);   

}

BOOTSELLED1239USBRaspberryPiPico©2020RP2-8020/21P64M15.00TTT