Browse Source

drivers/nrf24l01: Change pipe addrs in test to match Arduino addrs.

These addresses were initially chosen to match the nRF24 Arduino library
examples but they are byte-reversed.  So change them to be on-air
compatible with the Arduino library.

Also, the data sheet for the nRF24 says that RX data pipes 1-5 must share
the same top 32-bits, and must differ only in the LSbyte.  The addresses
used here (while correct because they are on TX pipe and RX pipe 0) are
misleading in this sense, because it looks like they were chosen to share
the top 32-bits per the datasheet.
pull/5644/head
Peter Hinch 5 years ago
committed by Damien George
parent
commit
d2f22ea953
  1. 4
      drivers/nrf24l01/nrf24l01test.py

4
drivers/nrf24l01/nrf24l01test.py

@ -23,7 +23,9 @@ elif sys.platform == 'esp32': # Software SPI
else: else:
raise ValueError('Unsupported platform {}'.format(sys.platform)) raise ValueError('Unsupported platform {}'.format(sys.platform))
pipes = (b'\xf0\xf0\xf0\xf0\xe1', b'\xf0\xf0\xf0\xf0\xd2') # Addresses are in little-endian format. They correspond to big-endian
# 0xf0f0f0f0e1, 0xf0f0f0f0d2
pipes = (b'\xe1\xf0\xf0\xf0\xf0', b'\xd2\xf0\xf0\xf0\xf0')
def master(): def master():
csn = Pin(cfg['csn'], mode=Pin.OUT, value=1) csn = Pin(cfg['csn'], mode=Pin.OUT, value=1)

Loading…
Cancel
Save