Page 1 of 1

nrf24l01 with Pico

Posted: Sun Aug 07, 2022 2:15 pm
by VNN
I'm trying to run this code on my Pico : https://github.com/micropython/micropyt ... l01test.py, but I got this error: ValueError: Unsupported platform rp2. How can I fix it?

Re: nrf24l01 with Pico

Posted: Sun Aug 07, 2022 4:32 pm
by scruss
It's not surprising that rp2 isn't supported, since this code was last touched before the Raspberry Pi Pico was launched.

Possible (untested) solution: add the following lines before the else: on line 23:

Code: Select all

elif usys.platform == "rp2":  # Hardware SPI
    cfg = {"spi": 0, "miso": 4, "mosi": 7, "sck": 6, "csn": 5, "ce": 8}
then connect RX to GP4, TX to GP7, SCK to GP6, CSn to GP5 and CE to GP8.