 float LPFilter(float input, float pre_result);
 void sendProcessing();
 
+int startTime = 0;
+int endTime = 0;
+
 unsigned char total_rotate[8] = {0,};
 // the cs pin of the version after v1.1 is default to D9
 // v0.9b and v1.0 is default D10

}

void loop() {
  getAngleSignal();

  ch1 = getRemoteSignal(6);
  ch1Filter = LPFilter(ch1, ch1Filter, 1, 1);
  if (ch1Filter < 100) {rearVoltage = 0;}
  else {rearVoltage = receiverScaler(ch1Filter, 19, 1550, 300);}
  float2Bytes(rearVoltage, motor_1_back);
  memcpy(total_rotate,     motor_1_front, 4 * sizeof(unsigned char)); // copy 4 floats from x to total[0]...total[3]
  memcpy(total_rotate + 4, motor_1_back, 4 * sizeof(unsigned char)); // copy 4 floats from y to total[4]...total[7]
  CAN.sendMsgBuf(0x01, 0, 8, total_rotate);

  ch2 = getRemoteSignal(5);
  ch2Filter = LPFilter(ch2, ch2Filter, 1, 1);
  if (ch2Filter < 100) {steeringTarget = 0;}
  else {steeringTarget = receiverScaler(ch2Filter, 600, 1500, 400);}
  error = (steeringTarget - (double)steeringCurrent);
  steeringOutput = error * kp + (error - prev_error) * kd;
  if (steeringOutput > 0) {

#endif

  prev_error = error;

  endTime = millis();
  Serial.println(' ');
  Serial.println(startTime - endTime);
}
//END LOOP

