nrf24l01 with Pico

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
Post Reply
VNN
Posts: 1
Joined: Sun Aug 07, 2022 2:11 pm

nrf24l01 with Pico

Post by VNN » Sun Aug 07, 2022 2:15 pm

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?

User avatar
scruss
Posts: 360
Joined: Sat Aug 12, 2017 2:27 pm
Location: Toronto, Canada
Contact:

Re: nrf24l01 with Pico

Post by scruss » Sun Aug 07, 2022 4:32 pm

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.

Post Reply