Hey... I've been playing a bit with PIC16F877A and C, but with the compiler I use, i cannot send variables to the LCD...
The function i use looks like this:
Where wrdata is:
And lcd_wait(), just waits for the busy flag to go down...
It works with constants.. of course - but it would be nice if I could write a variable to the LCD - results of calculations and stuff..
The function i use looks like this:
Code:
void lcd_display(const char *buf)
{
char i;
i = 0;
while(buf[i] != 0)
{
wrdata(buf[i++]);
}
}
Where wrdata is:
Code:
void wrdata (char data)
// Write a Character to the LCD Display.
{ trisb = 0;
portb = data;
porte = LCD_DATA_WR;
porte |= E_PIN_MASK;
nop();
porte &= ~E_PIN_MASK;
lcd_wait();
}
And lcd_wait(), just waits for the busy flag to go down...
It works with constants.. of course - but it would be nice if I could write a variable to the LCD - results of calculations and stuff..