Commit 58f6d8db authored by Avamander's avatar Avamander

Merge pull request #200 from SaintGimp/FixGettingStarted

Fix GettingStarted sample
parents 95926b2c 81f1c0d5
...@@ -56,8 +56,8 @@ if (role == 1) { ...@@ -56,8 +56,8 @@ if (role == 1) {
Serial.println(F("Now sending")); Serial.println(F("Now sending"));
unsigned long time = micros(); // Take the time, and send it. This will block until complete unsigned long start_time = micros(); // Take the time, and send it. This will block until complete
if (!radio.write( &time, sizeof(unsigned long) )){ if (!radio.write( &start_time, sizeof(unsigned long) )){
Serial.println(F("failed")); Serial.println(F("failed"));
} }
...@@ -78,15 +78,15 @@ if (role == 1) { ...@@ -78,15 +78,15 @@ if (role == 1) {
}else{ }else{
unsigned long got_time; // Grab the response, compare, and send to debugging spew unsigned long got_time; // Grab the response, compare, and send to debugging spew
radio.read( &got_time, sizeof(unsigned long) ); radio.read( &got_time, sizeof(unsigned long) );
unsigned long time = micros(); unsigned long end_time = micros();
// Spew it // Spew it
Serial.print(F("Sent ")); Serial.print(F("Sent "));
Serial.print(time); Serial.print(start_time);
Serial.print(F(", Got response ")); Serial.print(F(", Got response "));
Serial.print(got_time); Serial.print(got_time);
Serial.print(F(", Round-trip delay ")); Serial.print(F(", Round-trip delay "));
Serial.print(time-got_time); Serial.print(end_time-start_time);
Serial.println(F(" microseconds")); 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