CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Syntax Question..

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Joseph88



Joined: 14 Aug 2006
Posts: 17

View user's profile Send private message

Syntax Question..
PostPosted: Wed Aug 23, 2006 4:53 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Aug 23, 2006 8:28 am     Reply with quote

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








PostPosted: Wed Aug 23, 2006 9:12 am     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Wed Aug 23, 2006 9:46 am     Reply with quote

Then you have to change the lcd_putc to include the second argument.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group