         moveVehicle(RC_results[3]);
     else
         moveVehicle(MIN_ACC_OUT);
-
+        
     steer(RC_results[1]); 
     
     /* 5th pulse is rudder (position 3 on receiver; controlled by Left left/right joystick on transmitter) 

      rc_state = RC_WAIT;
          
      attachInterrupt(RC_INTERRUPT, ISR_rise, RISING);
      attachInterrupt(RC_INTERRUPT, ISR_fall, FALLING);
}
void ISR_rise()
{
    noInterrupts();
    unsigned long time = micros();
    for (register int i = 0; i < 8; i++)
    {
        register int index = (rc_index+i)&7;
        if (PIN_ORDER[index] == 0)
            continue;
        if (digitalRead(PIN_ORDER[index]) == HIGH)
        {
            rc_index = (rc_index+i) & 7;
            RC_results[rc_index] = time;
            rc_state = RC_PROCESSING;
            if (rc_index == 1)   // first signal of group
                RC_results[0] = RC_results[1];  // log starting time
            
        }
    }
    interrupts();
}
void ISR_fall()
{
    noInterrupts();
    if (PIN_ORDER[rc_index] != 0 && digitalRead(PIN_ORDER[rc_index]) == LOW)
    {
        unsigned int elapsed = RC_results[rc_index] - micros();
        if (elapsed > MAX_RC)
        {
            RC_results[rc_index] = INVALID_DATA;
            if (rc_index == 7)
                rc_state = RC_DONE;
        }
        else if (elapsed < MIN_RC)
        {
            RC_results[rc_index] = elapsed;
            if (rc_index == 7)
                rc_state = RC_DONE;
        }
        else; // spurious interrupt; wait for the next.
    }
    interrupts();
}
void loop()  {
    unsigned long Start_us = micros();
    unsigned long local_results[7];
    while (rc_state != RC_DONE)
        ;

    
    processRC(local_results);
}

void startCapturingRCState()
{
  synced = false;
  rc_index = 1;
  rc_state = RC_PROCESSING;
}

void processRC (unsigned long *RC_results)
{   
    // 1st pulse is aileron (position 5 on receiver; controlled by Right left/right joystick on transmitter)
