void main(){unsignedint temp_res;float K,I;int J;
K=11117.28;
I=0.01;
J=1;
ANSEL =0x01;// Configure AN2 pin as analog
ANSELH =0;// Configure other AN pins as digital I/O
C1ON_bit =0;// Disable comparators
C2ON_bit =0;
TRISA =0b00000011;// PORTA is input
TRISB =0b00000000;// PORTB is outputwhile(1){
temp_res = ADC_Read(2);// Get 10-bit results of AD conversion
PORTA = temp_res;// Send lower 8 bits to PORTBif(PORTA>K){
PORTB = PORTB+J*I;}else{
J=-J;
PORTB = PORTB+J*I;}
K=PORTA;
delay_ms(1ms);}}
If you are using MikroC, you'll see that error if you try and build a C file without creating/saving a project file. That's why starting all over worked out for you. If you get that error again, just go to Save Project As, etc and it should work.