   }
   Serial.println();
   
+}
+
+/*
+ * ISR for pin 2 (int.0)
+ */
+void isrMotion() {
+  // Tell the loop to power up the ping sensors.
+  pingPowerState = 1;
+  // Rest the awake time.
+  awakeTime = 0;
 }
 
 void setup() 

  NewPing(PIN_TRIG_RIGHT, PIN_ECHO_RIGHT, MAX_DISTANCE),
};


/**
 * Transmit the message.

#define PING_INTERVAL 33 // Milliseconds between sensor pings (29ms is about the min to avoid cross-sensor echo).

// Pins
const byte PIN_PIR = 2;         // PIR on external interupt to wake up the cpu, int.0 interupt 0 on pin 2

const byte PIN_RF_TX = 9;       // Pin 12 is the default sender pin but I want 9.
const byte PIN_RF_POWER = 10;   // Provide power to the transmitter
const byte PIN_PING_POWER = 14; // Controls the transistor switch for both ping sensors.

const byte PIN_TRIG_LEFT = 7;   // Send the ping on the left sensor.
