#define LED (0)
#define VR (28)
int value,duty;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, Raspberry Pi Pico!");
pinMode(LED, OUTPUT);
}
void loop() {
value = analogRead(VR);
Serial.print("Value ");
Serial.println(value);
duty = (100.0/1023)*value;
delay(1000);
Serial.print("Duty = ");
Serial.println(duty);
analogWrite(LED, duty);
delay(1000);
}