OK I now have a red face but what the heck,
I am sort of getting info now but have also had to adjust the sketches. Before I explain everything I will include the code agin, the wiring and the Monitor info.
Here goes,
//Arduino UNO
#include <SPI.h>
#include "RF24.h"
bool radioNumber = 0;
RF24 radio(9,10);
byte addresses[][6] = {"1Node","2Node"};
bool role = 1; // 0 = pong back , 1 = ping out
void setup() {
Serial.begin(115200);
while (!Serial) ; // wait for arduino serial monitor
delay(2000); // WNG - println's below started working after I put in this delay
Serial.println("RF24/examples/GettingStarted");
Serial.println("*** PRESS 'T' to begin transmitting to the other node");
radio.begin();
radio.setPALevel(RF24_PA_MIN);
if(radioNumber){
radio.openWritingPipe(addresses[1]);
radio.openReadingPipe(1,addresses[0]);
}else{
radio.openWritingPipe(addresses[0]);
radio.openReadingPipe(1,addresses[1]);
}
// Start the radio listening for data
radio.startListening();
radio.printDetails();
}
void loop() {
/****************** Ping Out Role ***************************/
if (role == 1) {
radio.stopListening();
Serial.println("Now sending");
unsigned long start_time = micros(); // Take the time, and send it. This will block until complete
if (!radio.write( &start_time, sizeof(unsigned long) )){
Serial.println("failed");
}
radio.startListening(); // Now, continue listening
unsigned long started_waiting_at = micros();
boolean timeout = false;
while ( ! radio.available() ){ // While nothing is received
if (micros() - started_waiting_at > 200000 ){
timeout = true;
break;
}
}
if ( timeout ){ // Describe the results
Serial.println("Failed, response timed out.");
}else{
unsigned long got_time; // Grab the response, compare, and send to debugging spew
radio.read( &got_time, sizeof(unsigned long) );
unsigned long end_time = micros();
// Spew it
Serial.print("Sent ");
Serial.print(start_time);
Serial.print(", Got response ");
Serial.print(got_time);
Serial.print(", Round-trip delay ");
Serial.print(end_time-start_time);
Serial.println(" microseconds");
}
// Try again 1s later
delay(1000);
}
/****************** Pong Back Role ***************************/
if ( role == 1 )
{
unsigned long got_time;
if( radio.available()){
// Variable for the received timestamp
while (radio.available()) { // While there is data ready
radio.read( &got_time, sizeof(unsigned long) ); // Get the payload
}
radio.stopListening(); // First, stop listening so we can talk
radio.write( &got_time, sizeof(unsigned long) ); // Send the final one back.
radio.startListening(); // Now, resume listening so we catch the next packets.
Serial.print("Sent response ");
Serial.println(got_time);
}
}
} // Loop
//Teensy 3.2
#include <SPI.h>
#include "RF24.h"
bool radioNumber = 1;
RF24 radio(9,10);
byte addresses[][6] = {"1Node","2Node"};
bool role = 0; // 0 = pong back , 1 = ping out
void setup() {
Serial.begin(115200);
while (!Serial) ; // wait for arduino serial monitor
delay(2000); // WNG - println's below started working after I put in this delay
Serial.println("RF24/examples/GettingStarted");
Serial.println("*** PRESS 'T' to begin transmitting to the other node");
radio.begin();
radio.setPALevel(RF24_PA_MIN);
if(radioNumber){
radio.openWritingPipe(addresses[1]);
radio.openReadingPipe(1,addresses[0]);
}else{
radio.openWritingPipe(addresses[0]);
radio.openReadingPipe(1,addresses[1]);
}
// Start the radio listening for data
radio.startListening();
radio.printDetails();
}
void loop() {
/****************** Ping Out Role ***************************/
if (role == 0) {
radio.stopListening();
Serial.println("Now sending");
unsigned long start_time = micros(); // Take the time, and send it. This will block until complete
if (!radio.write( &start_time, sizeof(unsigned long) )){
Serial.println("failed");
}
radio.startListening(); // Now, continue listening
unsigned long started_waiting_at = micros();
boolean timeout = false;
while ( ! radio.available() ){ // While nothing is received
if (micros() - started_waiting_at > 200000 ){
timeout = true;
break;
}
}
if ( timeout ){ // Describe the results
Serial.println("Failed, response timed out.");
}else{
unsigned long got_time; // Grab the response, compare, and send to debugging spew
radio.read( &got_time, sizeof(unsigned long) );
unsigned long end_time = micros();
// Spew it
Serial.print("Sent ");
Serial.print(start_time);
Serial.print(", Got response ");
Serial.print(got_time);
Serial.print(", Round-trip delay ");
Serial.print(end_time-start_time);
Serial.println(" microseconds");
}
// Try again 1s later
delay(1000);
}
/****************** Pong Back Role ***************************/
if ( role == 0 )
{
unsigned long got_time;
if( radio.available()){
// Variable for the received timestamp
while (radio.available()) { // While there is data ready
radio.read( &got_time, sizeof(unsigned long) ); // Get the payload
}
radio.stopListening(); // First, stop listening so we can talk
radio.write( &got_time, sizeof(unsigned long) ); // Send the final one back.
radio.startListening(); // Now, resume listening so we catch the next packets.
Serial.print("Sent response ");
Serial.println(got_time);
}
}
} // Loop






Teensy Mon.
Now sending
failed
Sent 159481763, Got response 255948888, Round-trip delay 231826 microseconds
Now sending
failed
Sent 160714233, Got response 257181400, Round-trip delay 231825 microseconds
Now sending
failed
Sent 161946696, Got response 258413920, Round-trip delay 231870 microseconds
Now sending
failed
Sent 163179209, Got response 259646432, Round-trip delay 231824 microseconds
Now sending
failed
Sent 164411671, Got response 260878952, Round-trip delay 231822 microseconds
Now sending
failed
Sent 165644138, Got response 262111472, Ro
UNO Mon.
failed
Failed, response timed out.
Now sending
failed
Failed, response timed out.
Now sending
failed
Failed, response timed out.
Now sending
failed
Failed, response timed out.
Now sending
failed
Failed, response timed out.
Now sending
failed
Failed, response timed