I'm trying to do an experiment to adapt the Multiwii code so that instead of a pwm signal I emulate voltage ,proportional to the number of the PWM signal (with the instruction analogWrite), but managed not find the specific place in the code where it sends order to output.
I've found the place where the value of the PWM signal is defined, in the output.cpp:
Code: Select all
if(f.PASSTHRU_MODE){ // Direct passthru from RX
servo[3] = rcCommand[ROLL] + flapperons[0]; // Wing 1
servo[4] = rcCommand[ROLL] + flapperons[1]; // Wing 2
servo[5] = rcCommand[YAW]; // Rudder
servo[6] = rcCommand[PITCH]; // Elevator
}else{
// Assisted modes (gyro only or gyro+acc according to AUX configuration in Gui
servo[3] = axisPID[ROLL] + flapperons[0]; // Wing 1 <-----------
servo[4] = axisPID[ROLL] + flapperons[1]; // Wing 2 <----------- These are the values that I
servo[5] = axisPID[YAW]; // Rudder <----------- want to change by voltages
servo[6] = axisPID[PITCH]; // Elevator <-----------
}
for(i=3;i<7;i++) {
servo[i] = ((int32_t)conf.servoConf[i].rate * servo[i])/100L; // servo rates
servo[i] += get_middle(i);
}
#elif defined( SINGLECOPTER )
/*************************** Single & DualCopter ******************************/
where are the code that send to the outputs the final instruccion to move the servos? is in the writeServos() function in the same file? Where?
tks for your time.