I just bought 2 new raspberry pi pico units, but I am struggling with them. I ran a few basic commands in Thonny's shell and maid a program to have the onboard LED blink. Everything is working fine but I can't run any program that has external connections. I can't blink an external led, check if a button is pressed, etc. This happens with both the pico boards. Here is how I installed the Pico requirements :
- I installed Thonny and flashed the micro-python firmware(.uf2) to the Pico in boot-loader mode (RPI-RP2 mass storage device).
- When I flashed the firmware though, the file finished transferring and the pico ejected itself, then I opened it in bootloader mode again but the firmware file isn't showing itself in the RPI-RP2 path, does that mean the firmware didn't install? Also "Micro-python version1.19..." does show up on my Thonny's shell screen.
- I installed micro-python from Thonny's "Configure Interpreter > Interpreter > Update or Install Micropython" tab too.
Here is the code I used for Led Toggle-
import machine
import utime
led = machine.Pin(7, machine.Pin.OUT)
while True:
led.value(1)
utime.sleep(1)
led.value(0)
utime.sleep(1)
I connected an 220 ohms resistor and an LED(anode) in series with the pin labelled GP7 and the ground of the Pico(one of the pins labelled GND) to the cathode of the led. I changed the code to 15 and used the pin labelled GP15 with both the Pico boards but the LED doesn't blink, it doesn't even turn on. I added a print("ON")
after led.value(1)
statement and the shell prints "ON" but the led does not blink.
Anyone know what the problem might be? Is it a pico problem or a GPIO problem or a firmware problem?
RPI-RP2
device not showing the contents is fine. It's not a typical mass-storage device you can write to and read from like a USB drive. If you flashed the micro-python firmware.uf2
file to it, theRPI-RP2
device should disappear when the flash completes and entering boot-mode again will not show anything present in that device. I would be suspicious that entering boot-mode again may have caused issues with the original flash of the micropython firmware. Do it again and trust it is there. I could help further with C, but not python. There are many example to go by.