Praveen Kumar P S
Member level 4
- Joined
- Aug 21, 2014
- Messages
- 79
- Helped
- 1
- Reputation
- 2
- Reaction score
- 1
- Trophy points
- 8
- Location
- India
- Activity points
- 627
Hello friends...
This program is for reading the Temperature and display it on a lcd display at the same time the pic serially transmit the temperature.....My program works.....:roll::roll:..But it is not displaying any negative temperature....:bang::bang::bang:
plzz help guys...............
Here is my code:::
This program is for reading the Temperature and display it on a lcd display at the same time the pic serially transmit the temperature.....My program works.....:roll::roll:..But it is not displaying any negative temperature....:bang::bang::bang:
plzz help guys...............
Here is my code:::
Code:
#include <18f4550.h>
#device ADC=10
#fuses HS,NOWDT,NOPUT,NOPROTECT,NODEBUG,BROWNOUT,NOLVP,NOCPD,NOWRT
#use delay(crystal=48000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7)
#include<flex_lcd416.c>
void main()
{
unsigned int8 t;
lcd_init();
lcd_gotoxy(4,1);
lcd_putc("Temperature\n");
setup_port_a(ALL_ANALOG);
setup_adc( ADC_CLOCK_INTERNAL);
setup_adc_ports(AN0);
for(;;)
{
set_adc_channel(0);
delay_ms(10);
t = read_adc()/2;
lcd_gotoxy(6,3);
printf("Temp::\t%3.0u \xDFC\n\r",(unsigned int8)t);
printf(lcd_putc,"%3.0u \xDFC ",(unsigned int8)t);
delay_ms(10);
}
}