Excuse me, I saw the program about Wireless Serial using nRF24L01+ from this website, which happened to be what I needed, but when I compiled the program provided on the website, I got this error:
RF_UART:97:43: error: void value not ignored as it ought to be
done = radio.read(&RecvPayload,len);
^
exit status 1
void value not ignored as it ought to be
Does anyone know what's wrong???
Your post was MOVED to its current location as it is more suitable.
Please post your full sketch and error messages, using code tags when you do
You are using a sketch that was designed for the old ManiacBug NRF24L01 library.
I would advise to update the sketch to use the newer NRF24L01 library,
which you seem to have installed already.
radio.read()
now does not return anything anymore, it just reads the packet.
The return value was used most of the time to silently drop packets by overwriting them
before processing, so in a way that API change was a good thing.
Sorry for my bad English, google translate
Thank you Whandall
I originally used the RF24 V1.4.1 library provided by ARDINO, the compilation will be abnormal
Now I switch to RF24-master of GitHub - maniacbug/RF24: Arduino driver for nRF24L01 and now it can compile normally, thank you very much
I have encountered a new problem, I use the program provided by this website Wireless Serial using nRF24L01+ | circuits4you.com
And modified UBRR0L = 103; //103 @ 16MHz 51 @ 8MHz for ARDUINO UNO
I tested the program, I sent: 30H from COM1, but COM2 received: C8H
The reverse is also true, in short, the data transmission is abnormal, I hope you can help
The stuff you linked uses that idiotic technique I mentioned above.
if ( radio.available() ) {
bool done = false;
while ( !done ) {
len = radio.getDynamicPayloadSize();
done = radio.read(&RecvPayload,len);
delay(5);
}
I would not trust anything from that sketch.
And no, I am not interested in debugging any application of it.
OK , Thanks
Try the examples in Simple nRF24L01+ 2.4GHz transceiver demo
Okay, I will try, thank you very much
Regarding Wireless_Serial_using_nRF24L01 I finally knew the problem:
- I use RF24 libraries: GitHub - maniacbug/RF24: Arduino driver for nRF24L01
- Setting the baud rate needs to consider the Oscillator of 8MHZ OR 16MHZ
3.Set baud rate: I refer to: AVR Atmega328P UART
Finally it can work normally, thank you everyone
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.