This sketch is demonstrates how to interact with the audio library directly using the core RF24 radio library: http://nRF24.github.io/RF24/.
This sketch is demonstrates how to interact with the audio library directly using the core RF24 radio library: http://nRF24.github.io/RF24/
#include <RF24.h>
#include <SPI.h>
#include "printf.h"
RF24 radio(7,8);
const uint64_t addresses[2] = { 0xABCDABCD71LL, 0x544d52687CLL};
void setup() {
Serial.begin(115200);
printf_begin();
radio.begin();
radio.setChannel(1);
radio.setAutoAck(0);
radio.setCRCLength(RF24_CRC_8);
radio.openWritingPipe(addresses[0]);
radio.openReadingPipe(1,addresses[1]);
radio.printDetails();
radio.startListening();
Serial.println("Setup OK. Begin transmission of audio");
}
byte audioData[32];
byte samplesToDisplay = 3;
void loop() {
if(radio.available()){
radio.read(&audioData,32);
for(int i=0; i<samplesToDisplay; i++){
Serial.write(audioData[i]);
}
Serial.println("");
}
}