stm32 bluepill potentiometer led not lighting

Hi, I'm testing a sketch that uses a potentiometer to control the speed of a blinking LED with an stm32 bluepill, but my LED isn't turning on. I've connected by A0 pin to the potentiometer and my B6 pin to the LED. Here's the circuit. (Sorry the wires are weird, I ran out of red and black) I'm using this diagram, but with A0 instead of A2 and B6 instead of D4.

Here's the code:

int potPin = PA0;
int ledPin = PB6;
int val=0;

void setup() {
pinMode (ledPin, OUTPUT);//Sets the LED pin as an output
}

void loop() {
val = analogRead(potPin); //reads the analogue voltage from the pot via ADC and stores it in the variable


digitalWrite(ledPin, HIGH); //turn the LED output pin high turning the LED on 


delay(val); //waits an amount of time dependent on the potentiometer position


digitalWrite(ledPin, LOW); //turn the LED output pin low turning the LED off


delay(val); //waits an amount of time dependent on the potentiometer position


}

Let me know if you need more info!

Your BOOT0 jumper is in the wrong position. your sketch won't start

I don't know about that, I ran a servo motor and blink program with the same configuration. The sketch flashes:

It may run once, but after a reset or re-power I would be surprised if it did. Try both jumpers towards the USB connector.
If I run your sketch on my Bluepill it works just fine. I use PC13 (internal led) though.

Try then the built in led at pin pc13 instead. I have difficulty relating the picture you supplied of your breadboard to the sketch and the wiring to the led appears to be incorrect.