     {
       temp = ble_read();
       if ('r' == temp) { // read comand from smartphone)
-//        int length = 4+sizeof(curDistance);
-//        String output = "D:";
-//        output+=curDistance;
-//        output+="\n";
-//        byte length= 8;
-          
-        
-//        char distanceBuf[10];
-//        
-//        ltoa(curDistance,distanceBuf,10);
-//        int length;
-//
-//   for (byte i = 0;i<sizeof(distanceBuf);i++){
-//       if (distanceBuf[i]==NULL) {
-//              length=i+1;
-//              break;
-//            } 
-//         }
-//         char outBuf[length];
-//         for (byte i = 0;i<length;i++){
-//            outBuf[i]=distanceBuf[i];
-//         } 
-//         
-
-
-//         ble_write(length);
-         ble_write('D');
-         ble_write(':');
-//          ble_write_bytes((unsigned char *)outBuf,length);
-          ble_write('\n');
-//          ble_write_bytes();
+          stroller_ble_print();
       } 
       else if ( 'c' == temp ) { // aCcept or commit command from smartphone, later used for resetting
         curDistance=0;
         ble_write('r');
         ble_write('\n');
       }
-      //            temp = ble_read();
-      //            if('o' == temp)
-      //            {
-      //                temp = ble_read();
-      //                if('n' == temp)
-      //                {
-      //
-      //                    ble_write_bytes((unsigned char *)"LED on", 6);
-      //                }
-      //                else if('f' == temp && 'f' == ble_read())
-      //                {
-      //                    ble_write_bytes((unsigned char *)"LED off", 7);
-      //                }
-      //            }
     }
   }
 //  delay(50);

  PRR1 = 0x00;
  digitalWrite(LED,HIGH);
  hadRound = 1;
  //    delay(100);  //jitters elimination
  //    if(LOW == digitalRead(1))
//  if ( ble_connected() )
//  {
//    ble_write_bytes((unsigned char *)"Button down", 11);
//  }

}




    // Open up the file we're going to log to!
    dataFile = SD.open("datalog.txt", FILE_WRITE);
     runs=SD.open("run.txt",FILE_WRITE);
  }

