ananthashayanams
Junior Member level 2
- Joined
- Jul 21, 2007
- Messages
- 20
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,455
Hi,
I have an issue with displaying multiple values on the 2nd line of 16x2 LCD. There are 4 channels of ADC which I am using to read the values & display it on LCD. The reading from the ADC is fine, but displaying it in a scroll manner only on the 2nd line is an issue. My first Line is also scrolling.
This is the code i wrote to print the ADC value on the LCD, but sometimes values mix up between 1st & 2nd line, 2 values get overwritten on the same location. Can anybody suggest which is the best way to write multiple values only in the 2nd line which is going back to back.
I have an issue with displaying multiple values on the 2nd line of 16x2 LCD. There are 4 channels of ADC which I am using to read the values & display it on LCD. The reading from the ADC is fine, but displaying it in a scroll manner only on the 2nd line is an issue. My first Line is also scrolling.
This is the code i wrote to print the ADC value on the LCD, but sometimes values mix up between 1st & 2nd line, 2 values get overwritten on the same location. Can anybody suggest which is the best way to write multiple values only in the 2nd line which is going back to back.
Code:
void main() {
...
pic_init();
lcd_init();
...
lcd_putc(" GUI SYSTEM \n")
while(1) {
...
current = average_ad(AMP_CHAN)/40.885;
printf(lcd_putc," Solar Current=%6.2fA\n\r",current);
voltage = average_ad(VOLT_CHAN)/18.2887;
lcd_gotoxy(22,2);
printf(lcd_putc," Solar Voltage=%6.2fV\n\r",voltage);
}