#define panel GPIO.F5 #define carga GPIO.F2 #define chPot 0 #define chBat 1 #define chStat 3 int lectStat =0; int lectBat1=0; int lectBat2=0; int lectPot=0; void main() { ANSEL=0X10; ADCON0=0X81; CMCON=0X07; VRCON=0X00; TRISIO.F0=1; TRISIO.F1=1; TRISIO.F2=0; TRISIO.F3=1; TRISIO.F4=1; TRISIO.F5=0; GPIO=0; while(1){ lectStat= ADC_Read(chStat); if(lectStat>368){ //368 equivale a 1.8v //Comportamiento de día // delay_ms(50); lectBat1=ADC_Read(chBat); lectPot=ADC_Read(chPot); if(lectBat1