sachinkallely
Newbie level 3
- Joined
- Jan 1, 2011
- Messages
- 3
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Location
- hyderabad
- Activity points
- 1,314
Hi i am using pic16f676 for a cyclic timer. I am coding in MikroC. Attaching the code below. Proteas simulation is giving out errors.Help me out please
Code:
unsigned long int x,k;
void main()
{
ADCON1=0x80;
TRISA=0xFF;
TRISC=0x00;
do {
x = ADC_Read(0);
k=(x/4);
if(0<k && k<128)
{
PORTC.F5=1;
Delay_Ms(1000);
PORTB.F5=0;
Delay_Ms(1000);
}
if(128<k && k<255)
{
PORTB.F5=1;
Delay_Ms(3000);
PORTB.F5=0;
Delay_Ms(3000);
}
} while(1);
}