sooyassine1
Newbie level 6
hi,
please i have a problem in my "simple" program , i have this error :main function is not defined
here is the program
thanks for ur inswers
please i have a problem in my "simple" program , i have this error :main function is not defined
here is the program
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 void main() { unsigned int 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 output while (1) { temp_res = ADC_Read(2); // Get 10-bit results of AD conversion PORTA = temp_res; // Send lower 8 bits to PORTB if(PORTA>K) { PORTB = PORTB+J*I; } else { J=-J; PORTB = PORTB+J*I; } K=PORTA; delay_ms(1ms); } }
thanks for ur inswers
Last edited by a moderator: