// LCD module connections
sbit LCD_RS at RC4_bit;
sbit LCD_EN at RC5_bit;
sbit LCD_D4 at RC0_bit;
sbit LCD_D5 at RC1_bit;
sbit LCD_D6 at RC2_bit;
sbit LCD_D7 at RC3_bit;
sbit LCD_RS_Direction at TRISC4_bit;
sbit LCD_EN_Direction at TRISC5_bit;
sbit LCD_D4_Direction at TRISC0_bit;
sbit LCD_D5_Direction at TRISC1_bit;
sbit LCD_D6_Direction at TRISC2_bit;
sbit LCD_D7_Direction at TRISC3_bit;
// End LCD module connections
void main()
{
unsigned long mV;
char txt1[]= "nanda";
char temperature;
int temp;
char txt[4];
TRISA=0xFF;
TRISC=0x00;
OSCCON=0x72;
ADCON0=0x51;
ADCON1=0x80;
Lcd_Init(); // Initialize LCD
// Clear display
// Cursor off
Lcd_Out(1,1,txt1); // Write text in first row
delay_ms(1000);
while(1)
{
temp = Adc_Read(2); // Read temp
mV = (unsigned long)temp *5000 / 1024; // in mV
temperature= mV/10;
BytetoStr(temperature,txt);
Lcd_Out(2,1,txt);
delay_ms(1000);
}
}
this is my code....
i got the output in proteus isis but not on breadboard...i dont knw wer im gng wrong....sometimes the lcd shows black square boxes and sometimes it is blank...