Änderungen

Aus Hackerspace Ffm
Wechseln zu: Navigation, Suche

NRF24L01 Issues

478 Byte hinzugefügt, 20:13, 6. Mär. 2017
/* RF24 Library */
Radio frequency is not easy to handle, care must be taken on noise-free power-supply, proper antenna configuration, antenna ground area, shielding of module at higher power levels and so on. With proper care, the module can transmit over distances over 1km, but with improper care the module somethings don't even reach more than 1m.
==Understanding issues = =  
== Clones ==
== RF24 Library ==
 
=== Working with dynamic payloads ===
The library is very unintuitive and buggy in this behaviour. To recevie a packet with dynamic payload, do this:
 
<pre>
if(radio.available()){
uint8_t payloadsize = radio.getDynamicPayloadSize();
if(payloadsize < 1){
// Corrupt payload has been flushed
return;
} else {
radio.setPayloadSize(payloadsize); // THIS IS IMPORTANT TO DO DUE CRAPPY LIB
radio.read(&data,sizeof(data));
}
}
</pre>
1.954
Bearbeitungen