Commit 81f1c0d5 authored by Eric Lee's avatar Eric Lee

Fix GettingStarted sample

The GettingStarted sample is apparently intended to send a number from the transmitter
to the receiver and echo that same number back again, but the code wasn't outputting
the echoed number properly. Now it doesn, and the user can see that the same number was
sent and echoed back.
parent 95926b2c
......@@ -56,8 +56,8 @@ if (role == 1) {
Serial.println(F("Now sending"));
unsigned long time = micros(); // Take the time, and send it. This will block until complete
if (!radio.write( &time, sizeof(unsigned long) )){
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(F("failed"));
}
......@@ -78,15 +78,15 @@ if (role == 1) {
}else{
unsigned long got_time; // Grab the response, compare, and send to debugging spew
radio.read( &got_time, sizeof(unsigned long) );
unsigned long time = micros();
unsigned long end_time = micros();
// Spew it
Serial.print(F("Sent "));
Serial.print(time);
Serial.print(start_time);
Serial.print(F(", Got response "));
Serial.print(got_time);
Serial.print(F(", Round-trip delay "));
Serial.print(time-got_time);
Serial.print(end_time-start_time);
Serial.println(F(" microseconds"));
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment