#include <Servo.h>

Servo PicoServo;

int ledpin = 1; //GP1
int potpin = 26; //GP26
int val = 0;

void setup()
{
  PicoServo.attach(0); //GP0
}

void loop() {
  val = analogRead(potpin);
  int LED = map(val, 0, 1024, 0, 255);
  int SERVO = map(val, 0, 1024, 0, 179);
  PicoServo.write(SERVO);
  analogWrite(ledpin, LED);
  delay(20);
}

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