Update Gateway.ino

This commit is contained in:
LowPowerLab 2013-08-07 21:44:23 -04:00
parent 67dbd270f3
commit 4f7057f7b3
1 changed files with 4 additions and 14 deletions

View File

@ -100,10 +100,10 @@ void loop() {
{ {
Serial.print(" Pinging node "); Serial.print(" Pinging node ");
Serial.print(theNodeID); Serial.print(theNodeID);
delay(5);
radio.send(theNodeID, "ACK TEST", 8, true);
Serial.print(" - ACK..."); Serial.print(" - ACK...");
if (waitForAck(theNodeID)) Serial.print("ok!"); delay(3); //need this when sending right after reception .. ?
if (radio.sendWithRetry(theNodeID, "ACK TEST", 8, 0)) // 0 = only 1 attempt, no retries
Serial.print("ok!");
else Serial.print("nothing"); else Serial.print("nothing");
} }
@ -113,16 +113,6 @@ void loop() {
} }
} }
// wait a few milliseconds for proper ACK to me, return true if indeed received
static bool waitForAck(byte theNodeID) {
long now = millis();
while (millis() - now <= ACK_TIME) {
if (radio.ACKReceived(theNodeID))
return true;
}
return false;
}
void Blink(byte PIN, int DELAY_MS) void Blink(byte PIN, int DELAY_MS)
{ {
pinMode(PIN, OUTPUT); pinMode(PIN, OUTPUT);