....
while (1)
{
SetChanADC (ADC_CH0); // Encender Ch 0 - ADC
Delay10TCYx (5); // Demora para aquisition time
ConvertADC (); // Hacer conversion Ch 0
while (BusyADC()); // Esperar hasta completar conversion
// Lee ADC y guarda en variable eje_Y:
eje_Y = ReadADC() & 0x3FF;
/*******************************************************************/
SetChanADC (ADC_CH1); // Encender Ch 1 - ADC
Delay10TCYx (5); // Demora para aquisition time
ConvertADC (); // Hacer conversion Ch 1
while (BusyADC()); // Esperar hasta completar conversion
// Lee ADC y guarda en variable eje_X:
eje_X = ReadADC() & 0x3FF;
SetDCPWM2 (eje_X); // Programa DutyCycle2 al valor del ADC
SetDCPWM1 (eje_Y); // Programa DutyCycle1 al valor del ADC
//La diferencia de asignacion entre duttys es mucho menor
}
}