Hi there,
I have got 2 x ATTiny85's talking to each other with Nrf24L01 on the Mirf libraries (very chuffed with myself !)
I have written a bit of code for the RX board to search for the channel that is being transmitted by the TX board (that is the easy bit)
But on the TX board, I have written a spec for a 'best channel search' - the only problem is, I dont really know how to implement the Carrier Detect function. What I would like to do is listen on each channel for xx times, log all the results and choose the best channel to transmit on. The Address-Pipe would contain the value of the channel, so it would be easy to find !! - There is a 'scanner' sketch for 328's and the RF24 library, but I cant work out how to convert it to the Mirf and Tiny85
Can anyone give me some help on implement the CD in the MIRF library please
Thanks in Advance !!!
PS, here is the code I am going to use in the RX boards to 'find' the transmitter
void channelSearch(void) {
uint8_t rfChan;
boolean chnFound;
while (!chnFound) {
for (rfChan=0; rfChan<MAX_RF_CHANNELS; rfChan++) {
Address[0] = Address[1] = Address[2] = Address[3] = Address[4] = rfChan;
Mirf.channel = rfChan;
Mirf.setRADDR(Address);
Mirf.config();
delayMicroseconds(50);
for (uint8_t x=0; x<200; x++) {
if ( Mirf.dataReady() ) { // found data, so set channel and write to eeprom
EEPROM.write(0,rfChan);
chnFound=true;
return;
} // if
delay(5); // 5ms x 200 = 1s // 83 channels would take 84 seconds to scan
} // for x
} // for rfChan
} // while
}