warrior_16th
Newbie level 6

i was searching about some temperature sensor code and i get one but actually i didnt understand it well iam just new at this field and this code have alot of function that i actually didn understand it so if anyone could help me and give me an explaination for each line i will be thank full
this the code :
int temp1;
char temp[10];
void adc(){
temp1=ADC_READ(0);
temp1=temp1*0.245*2;
INTToStr(temp1,temp);}
void main() {
TRISA = 0xFF;
TRISD=0;PORTD=0;
TRISB=0;PORTB=0;
TRISc=1;PORTc=0;
Uart1_init(9600);
Lcd_Init();
lcd_cmd(_LCD_CURSOR_OFF);
while (1) {
lcd_out(1,10,temp);
UART1_Write_Text("temperature");
UART1_Write_Text(temp);UART1_Write(13);UART1_Write(10);;Delay_ms(1000);;
adc();
} }
this the code :
int temp1;
char temp[10];
void adc(){
temp1=ADC_READ(0);
temp1=temp1*0.245*2;
INTToStr(temp1,temp);}
void main() {
TRISA = 0xFF;
TRISD=0;PORTD=0;
TRISB=0;PORTB=0;
TRISc=1;PORTc=0;
Uart1_init(9600);
Lcd_Init();
lcd_cmd(_LCD_CURSOR_OFF);
while (1) {
lcd_out(1,10,temp);
UART1_Write_Text("temperature");
UART1_Write_Text(temp);UART1_Write(13);UART1_Write(10);;Delay_ms(1000);;
adc();
} }