New Pico Plus 2 W LED?

Using LED as suggested I can’t get the onboard LED to work. I’m using

Import machine import Pin
led = Pin(“LED”, Pin.OUT)
led.on()

I’d guess you don’t need the quotation marks, as that makes it a text string rather than a variable.

This worked for me. I have the non wireless Pico Plus 2.

from machine import Pin
led = Pin(25, Pin.OUT)

led.toggle()

EDIT: try this

from machine import Pin
led = Pin(25, Pin.OUT)
led.on()

The product page implies that this won’t work for the wireless version, because the LED is connected to the wireless chip rather than the RP2350. I assume that’s why they recommend the LED variable instead of pin 25.

The user LED is wired to WL_GPIO0, just like on an ordinary Pico W. You can blink it in the same way as a regular Pico, by using “LED” in place of 25.

After I posted I was thinking I’d get crossed up by his being the W version. You were quicker than me trying to find that info.
One problem is in his posted code the first Import has a capital I, it should be “import” not “Import”

Pin 25 isn’t connected to the LED on W versions.

1 Like

Sorry about that, I had my Pico Plus 2 sitting there on my desk with Thonny already connected and ready to go. It my hast to get going I missed that his was the W version.

from machine import Pin
led = Pin(LED, Pin.OUT)

led.toggle()

Maybe?

LED has to be in quotes. It doesn’t work on my board.

What code did you use, and what error did it give?

import machine
led = machine.Pin(“LED”, machine.Pin.OUT)
while True:
led.toggle()

No error. LED does not turn on.

It should be:

from machine import Pin
led = Pin(“LED”, Pin.OUT)
led.toggle()

I agree with “No error. LED does not turn on.”

from machine import Pin
from sys import implementation
import time

print(implementation._machine)
led = Pin("LED", Pin.OUT)

while True:
    led.value(1)
    time.sleep(1.0)
    led.value(0)
    time.sleep(1.0)

Printing out the implementation gives:

Pimoroni Pico Plus 2 (Wireless + PSRAM) with RP2350

Thanks. It wasn’t me doing something silly. I’m not using the PSRAM version.

I’ve raised a support query about it.

Very odd. Might be a bug in their MicroPython implementation then, it would be worth flagging that on their github.

You might want to scan through the thread “RP2350 Pico2 + W”. I can connect to Wi-Fi using a MicroPython uf2 build recommended in the thread but that is all. My server and real-time-clock MicroPython code connects to Wi-Fi and I can print out the IP address, but it then just sits there doing nothing. I retested it all on a Pico 1 W and the code ran fine on that board.

I’m confident that the Pirates will get it sorted but at the moment the hardware is ahead of the software.

I’ve posted it to GitHub.

I got this from Pimoroni support:

Subject: Re: [pimoroni/pimoroni-pico-rp2350] New Pico Plus 2 W LED problem (Issue #11)
Sent: 30 September 2024 12:17:23 BST
From: Philip Howard notifications@github.com
To: pimoroni/pimoroni-pico-rp2350 pimoroni-pico-rp2350@noreply.github.com
Cc: Leon Heller leon355@btinternet.com, Author author@noreply.github.com

Yup, I appear to have mucked this up trying to avoid having two many different builds for PPP2 and PPP2W.

Try: https://github.com/pimoroni/pimoroni-pico-rp2350/actions/runs/11104523856/artifacts/1994953669

You will need to use machine.Pin("LEDW") for frustratingly awkward reasons.


Reply to this email directly or view it on GitHub:

You are receiving this because you authored the thread.

Message ID: pimoroni/pimoroni-pico-rp2350/issues/11/2382899909@github.com

Thank you for your work on this. I have been dragged sideways into another project but I will catch up at some point.

Just got it to work with the new MicroPython version supplied by Pimoroni. “LEDW” required instead of “LED”.

1 Like