CHanged default data rate to 1MBps and default channel to 100 for better performance
This commit is contained in:
parent
7aeaf0d373
commit
5344c5fe8c
7
RF24.cpp
7
RF24.cpp
|
@ -351,7 +351,10 @@ void RF24::begin(void)
|
||||||
{
|
{
|
||||||
p_variant = true ;
|
p_variant = true ;
|
||||||
}
|
}
|
||||||
setDataRate( RF24_2MBPS ) ;
|
|
||||||
|
// Then set the data rate to the slowest (and most reliable) speed supported by all
|
||||||
|
// hardware.
|
||||||
|
setDataRate( RF24_1MBPS ) ;
|
||||||
|
|
||||||
// Initialize CRC and request 2-byte (16bit) CRC
|
// Initialize CRC and request 2-byte (16bit) CRC
|
||||||
setCRCLength( RF24_CRC_16 ) ;
|
setCRCLength( RF24_CRC_16 ) ;
|
||||||
|
@ -364,7 +367,7 @@ void RF24::begin(void)
|
||||||
write_register(STATUS,_BV(RX_DR) | _BV(TX_DS) | _BV(MAX_RT) );
|
write_register(STATUS,_BV(RX_DR) | _BV(TX_DS) | _BV(MAX_RT) );
|
||||||
|
|
||||||
// Set up default configuration. Callers can always change it later.
|
// Set up default configuration. Callers can always change it later.
|
||||||
setChannel(1);
|
setChannel(100);
|
||||||
|
|
||||||
// Flush buffers
|
// Flush buffers
|
||||||
flush_rx();
|
flush_rx();
|
||||||
|
|
|
@ -93,12 +93,6 @@ void setup(void)
|
||||||
// optionally, increase the delay between retries & # of retries
|
// optionally, increase the delay between retries & # of retries
|
||||||
radio.setRetries(15,15);
|
radio.setRetries(15,15);
|
||||||
|
|
||||||
// optionally, use a high channel to avoid WiFi chatter
|
|
||||||
radio.setChannel(110);
|
|
||||||
|
|
||||||
// optionally, increase the CRC length for improved reliability
|
|
||||||
radio.setCRCLength(RF24_CRC_16);
|
|
||||||
|
|
||||||
// optionally, reduce the payload size. seems to
|
// optionally, reduce the payload size. seems to
|
||||||
// improve reliability
|
// improve reliability
|
||||||
radio.setPayloadSize(8);
|
radio.setPayloadSize(8);
|
||||||
|
|
|
@ -104,12 +104,6 @@ void setup(void)
|
||||||
// optionally, increase the delay between retries & # of retries
|
// optionally, increase the delay between retries & # of retries
|
||||||
radio.setRetries(15,15);
|
radio.setRetries(15,15);
|
||||||
|
|
||||||
// optionally, use a high channel to avoid WiFi chatter
|
|
||||||
radio.setChannel(110);
|
|
||||||
|
|
||||||
// optionally, increase the CRC length for improved reliability
|
|
||||||
radio.setCRCLength(RF24_CRC_16);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Open pipes to other nodes for communication
|
// Open pipes to other nodes for communication
|
||||||
//
|
//
|
||||||
|
|
|
@ -94,12 +94,6 @@ void setup(void)
|
||||||
// We will be using the Ack Payload feature, so please enable it
|
// We will be using the Ack Payload feature, so please enable it
|
||||||
radio.enableAckPayload();
|
radio.enableAckPayload();
|
||||||
|
|
||||||
// Optional: Increase CRC length for improved reliability
|
|
||||||
radio.setCRCLength(RF24_CRC_16);
|
|
||||||
|
|
||||||
// Optional: Pick a high channel
|
|
||||||
radio.setChannel(110);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Open pipes to other nodes for communication
|
// Open pipes to other nodes for communication
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in New Issue