CanSat-India-Updated / sw integrn w telemetry
sw integrn w telemetry
Raw
bool telemetry=0;
// // with GCS commands
//void loop() {
//  if (XBee.available()) {
//    while (XBee.available()) {
//     char command = XBee.read();
//  switch (command)
//    {
//      case 'x': //telemetry on/off
//           telemetry=telemetry^1;
//           while (telemetry==1){
//            data_packet();
//            char command = XBee.read();
//            switch(command);
//           }
//           break;
//           
//      case 't': //set time
//            String sentence = mySerial.readStringUntil('\n');
//
//            while (!sentence.startsWith("$GNGGA")) {
//            sentence = "";
//            sentence += mySerial.readStringUntil('\n');
//            }
//
//            String parts[15];
//            int i = 0;
//            char * pch = strtok (sentence.c_str(), ",");
//            while (pch != NULL) {
//            parts[i++] = pch;
//            pch = strtok (NULL, ",");
//            }
//            
//            String time = parts[1];
//
//            IST(time);
//            break;
//            
//      case 'c':  //calibrate
//            for (int j = 0; j < 10; j++) { //calibration by taking mean of 10 BMP pressure readings
//            calibration += bmp.readPressure();
//            delay(50);
//            }
//            calibration /= 1000;
//
//            setTime(0, 0, 0, 24, 5, 2023);
//          break;
//          
//      default:
//      data_packet();
//      break;
//      }
//    }
//  }
//}