1

I'm having a problem reading from a Pico's GPIO port - at least it doesn't behave the same as on an Arduino.

The setup is pretty simple. There's a 433Mhz RF-receiver whose data-pin is connected to GPIO 16, and which is powered by the VBUS (i.e. with 5V):

Pico Setup

The program for reading the values is also super simple:

from machine import Pin

receiver_pin = Pin(16, Pin.IN)

while True:
    value = receiver_pin.value()
    print(value)

I've also tried adding Pin.PULL_DOWN and Pin.PULL_UP. But no matter what I do, I get garbage values. I've made a video showing the issue and comparing it to the following (equivalent) setup with an Arduino, which works just fine:

Arduino setup

I really don't know what to do about this, so I hope I'm just overlooking something :) Thanks

1
  • very poor quality video ... totally illegible
    – jsotola
    May 14 at 0:23
1

So apparently there's no problem at all. The only problem was that the Thonny IDE's serial plotter isn't as nice as the Arduino IDE's making it hard to spot that the correct inputs were actually received. Adding a small delay to the loop (0.01 seconds) solved the plotter issue. I now use the inbuilt LED (pin 25) as another form of input monitoring, because that seems to work much more reliably.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.