Page 1 of 1

Pin as string doesn't work

Posted: Tue Jul 12, 2022 6:05 pm
by jumperwire
Hello,

I have Raspberry Pi Pico W with:

Code: Select all

Python version
3.4.0; MicroPython v1.19.1 on 2022-06-18
Version info.
(3, 4, 0)
When I am trying to run the following:

Code: Select all

from machine import Pin

led = Pin( "LED", Pin.OUT )
led.on()
led.off()
I get an error:

Code: Select all

Traceback (most recent call last):
  File "<stdin>", line 4, in <module>
TypeError: can't convert str to int
I can't specify integer value for the LED, because on Pico W it's not pin 25 any more. I have no idea what integer number is the LED on. But everywhere in the google I see people are using string values as well as in documentation it says as id I can use string.
Any idea?

Re: Pin as string doesn't work

Posted: Tue Jul 12, 2022 10:04 pm
by scruss
You need to be using the latest unstable version for that to work

Re: Pin as string doesn't work

Posted: Tue Jul 12, 2022 10:53 pm
by iceelon
Hi !!!

you need the firmware for that device by default thonny does not recognize the W model, install manual it is in

Re: Pin as string doesn't work

Posted: Fri Jul 15, 2022 4:05 pm
by jumperwire
Thanks, it works now!