     if ((track != oldTrack) || ( (millis() - lastPowerSent) > 10000 ) ){  
       oldTrack = track;
       lastPowerSent = millis();
-      send_power_state(track);
+      if (track == 0) {
+         sendData(127,0);
+      } else {
+         sendData(127,1);
+      }
     }
 
 }

*/
void setup() {

    Serial.begin(9600);      // for comm with xbee
    pinMode(LED,OUTPUT);     // indicator for rec. packet
    xbee.setSerial(Serial);
    broadcast64 = XBeeAddress64(0, 0x0000FFFF);  //broadcast address

    delay(100); // give some time to initalize
}

/** transmit loco data as "adr data" broadcast
    to all xbees
*/
void sendData(uint8_t ch, uint8_t d) {
  for (int i=0; i <12; i++) {
    payload[i]=0;
  }
   payload[0]='F';  // for "feedback"
  // address (channel) to string
   uint8_t p3 = ch / 100;
   uint8_t p2 = (ch - 100*p3) / 10;
   uint8_t p1 = (ch - 100*p3 - 10*p2);
   uint8_t end = 3;
   
   if (p3 == 0) {
      payload[1]= (uint8_t)p2 + '0';
      payload[2]= (uint8_t)p1 + '0';
      payload[3]= ' ';
      end = 3;
   } else {
      payload[1]= (uint8_t)p3 + '0';
      payload[2]= (uint8_t)p2 + '0';
      payload[3]= (uint8_t)p1 + '0';
      payload[4]= ' ';
      end = 4;
   }

   // convert data to string
   p3 = d / 100;
   p2 = (d - 100*p3) / 10;
   p1 = (d - 100*p3 - 10*p2);
   if (p3 == 0) {
      payload[end+1]= (uint8_t)p2 + '0';
      payload[end+2]= (uint8_t)p1 + '0';
      payload[end+3]= '\n';
   } else {
      payload[end+1]= (uint8_t)p3 + '0';
      payload[end+2]= (uint8_t)p2 + '0';
      payload[end+3]= (uint8_t)p1 + '0';
      payload[end+4]= '\n';   // index max. 8 (of 11)
   }

#if defined(_DEBUG) || defined(_DEBUG_AVR)
   sendPayloadToSerial();
#endif   // defined(_DEBUG) || defined(_DEBUG_AVR)

#ifndef _DEBUG_AVR
   xbee.send(zbTx);
#endif
}

/** receive loop for:
