  * 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;
+  bitSet(flags, F_MOTION);
 }
 
 void setup() 
 {
   Serial.begin(115200);
+  
+  bitClear(flags, F_MOTION);
+  bitClear(flags, F_LEFT);
+  bitClear(flags, F_RIGHT);
   
   pinMode(PIN_PING_POWER, OUTPUT);
   

  }
  
  // Other code that *DOESN'T* analyze ping results can go here.
  
  if (millis() - lastTransmit > 1000) {
    // Proof of concept to power cycle the pings
    pingPowerState =!pingPowerState;

/*
 Sleep until motion is detectected,
 then turn on the two ping sensors which detect if someone goes past and in which direction.
 Transmit the detected direction.
*/

// http://www.nongnu.org/avr-libc/user-manual/group__avr__power.html
