-
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
no connection from pi pico to arduino #43
Comments
set nrf.dynamic_payloads = False There are a few differences between the C++ and CirPy libs outlined at the bottom of the examples' doc. |
set it to
but still no success |
This needs to match whatever you passed to |
changed it to from circuitpython_nrf24l01.rf24 import RF24
spi = busio.SPI(clock=board.GP2, MOSI=board.GP3, MISO=board.GP4)
# change these (digital output) pins accordingly
CE_PIN = DigitalInOut(board.GP1)
CSN_PIN = DigitalInOut(board.GP0)
nrf = RF24(spi, CSN_PIN, CE_PIN)
nrf.pa_level = -12
address = [b"\xe1\xf0\xf0\xf0\xf0", b"2Node"]
nrf.open_tx_pipe(address[0]) # always uses pipe 0
nrf.open_rx_pipe(1, address[1])
nrf.data_rate = 250
nrf.channel = 100
nrf.allow_ask_no_ack = False
nrf.dynamic_payloads = False
nrf.listen = False
nrf.payload_length = 32
while True:
nrf.send(b"u") and changed the arduino code to #include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(7,8);
const byte address[5] = "00001";
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
if(!radio.begin()){
Serial.print("biggus dookes");
}
Serial.println("ready");
radio.setChannel(100);
radio.openReadingPipe(1, 0xE1F0F0F0F0);
radio.openWritingPipe(0xE2F0F0F0F0);
radio.setPALevel(RF24_PA_MIN);
radio.startListening();
radio.setDataRate(RF24_250KBPS);
radio.setPayloadSize(32);
// radio.setAutoAck(true);
// radio.powerUp();
}
void loop() {
if (radio.available()){
char text[32] = "";
radio.read(&text, sizeof(text));
Serial.print(text);
Serial.print("se\n");
}
} |
well, if that didn't work, then the addresses assigned to the pipe might be using conflicting endianness. In python: address = b"\xe1\xf0\xf0\xf0\xf0" # written in little endian In C++: uint8_t address[] = {0xe1, 0xf0, 0xf0, 0xf0, 0xf0}; // little endian (I think)
uint64_t addr = 0xe1f0f0f0f0; // big endian (I think) |
@skeyvin It is more memory efficient in C++ to use an array of bytes (like a c-string but without the NULL terminating byte). The ability to use a uint64_t address in C++ RF24 is officially deprecated, and it uses 8 bytes of memory to store a 5 byte address. |
Thanks for that kind stranger on the internet. uint8_t in combination with disabling dynamic payload worked |
i have this on the pico
and i have checked the wiring.
and i have this
on the arduino.
they work fine if i use the c++ version for the pi pico but when i use the circuitpython version i cant get any data to the arduino.
The text was updated successfully, but these errors were encountered: