From 7b401d7281d783b4a156ad4b9c4a41a18aec9fd0 Mon Sep 17 00:00:00 2001 From: maniacbug Date: Mon, 1 Aug 2011 21:05:54 -0700 Subject: [PATCH] Improve pingpair timing. Should lead to less timeouts. --- examples/pingpair/pingpair.pde | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/pingpair/pingpair.pde b/examples/pingpair/pingpair.pde index bd4b439..d9f2b7e 100644 --- a/examples/pingpair/pingpair.pde +++ b/examples/pingpair/pingpair.pde @@ -159,7 +159,7 @@ void loop(void) unsigned long started_waiting_at = millis(); bool timeout = false; while ( ! radio.available() && ! timeout ) - if (millis() - started_waiting_at > 250 ) + if (millis() - started_waiting_at > 200 ) timeout = true; // Describe the results @@ -200,6 +200,10 @@ void loop(void) // Spew it printf("Got payload %lu...",got_time); + + // Delay just a little bit to let the other unit + // make the transition to receiver + delay(20); } // First, stop listening so we can talk