View previous topic :: View next topic |
Author |
Message |
Joseph88
Joined: 14 Aug 2006 Posts: 17
|
Syntax Question.. |
Posted: Wed Aug 23, 2006 4:53 am |
|
|
Hello PIC C Professionals!
I'm getting a "Bad Syntax Error" when I compile the code indicated below, does anyone have any ideas?
lcd_putc("\fHello World\n", 1); <--get error here. works if I don't have the extra "1" argument added.
void lcd_putc(char* c, int8 lcdNum)
{
switch(c)
{
case '\f':
lcd_send_byte(0,1,lcdNum);
delay_ms(2);
break;
case '\n':
lcd_gotoxy(1,2,lcdNum);
break;
case '\b':
lcd_send_byte(0,0x10,lcdNum);
break;
default:
lcd_send_byte(1,c,lcdNum);
break;
}
}
Any ideas? As mentioned above, this code works if I don't have the extra argument for lcd_putc.
Thanks for the help!
J |
|
|
rberek
Joined: 10 Jan 2005 Posts: 207 Location: Ottawa, Canada
|
|
Posted: Wed Aug 23, 2006 8:28 am |
|
|
lcd_putc only accepts a single argument, which is a character string, so it won't like you adding another argument.
What were trying to accomplish with the extra argument? |
|
|
Guest
|
|
Posted: Wed Aug 23, 2006 9:12 am |
|
|
Hi rberek
Thanks for taking the time to reply to my post. I'm trying to write code for multiple LCD's. So instead of having multiple lcd_putc functions, i'd like to use just one.
J |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Wed Aug 23, 2006 9:46 am |
|
|
Then you have to change the lcd_putc to include the second argument. |
|
|
|