[Microbit-Python] Receiving radio.send() with NRF24L01

Radomir Dopieralski microbit at sheep.art.pl
Wed Mar 8 18:44:33 EST 2017


On Wed, 8 Mar 2017 23:54:42 +0100
Radomir Dopieralski <microbit at sheep.art.pl> wrote:

> Then I dug out my old pull request porting the nrf24l01.py driver to
> the new machine API for MicroPython, refreshed and fixed it (yes,
> there were bugs), and gave it a go with this short program for the
> ESP8266:
> 
> (Requires the library from
> https://github.com/deshipu/micropython/blob/35002c4e453c03f2b2f1e0f2ef810fb9a0bea0c4/drivers/nrf24l01/nrf24l01.py
> )

An updated program (after finding and solving some problems):

    import nrf24l01
    from machine import SPI, Pin

    radio = nrf24l01.NRF24L01(SPI(1), cs=Pin(15), ce=Pin(16),
                              channel=7, payload_size=32)
    radio.set_crc(2)
    radio.set_channel(7)
    radio.set_power_speed(nrf24l01.POWER_3, nrf24l01.SPEED_1M)
    radio.open_rx_pipe(0, u'ubit\x00')
    radio.start_listening()
    while True:
        if radio.any():
            print(radio.recv())

However, it still doesn't seem to work, at least with the modules I
have. It does work when I try a second NRF24L01 module with the same
settings, though.


-- 
Radomir Dopieralski

-- 
Radomir Dopieralski


More information about the Microbit mailing list