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

Code Error

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



Joined: 02 Nov 2005
Posts: 4

View user's profile Send private message

Code Error
PostPosted: Sun Nov 06, 2005 8:41 am     Reply with quote

When I run the below code I get the error "Expect a, or )" on the first line. I thought everything was defined correctly. Any suggestions?

--------------------------------------------------------------------------------

void delay_10us(byte t); // max of 255 * 10 us
void delay_ms(long t); // delays t millisecs - max of 65,535 ms

void lcd_char(byte c);
void lcd_data_nibble(byte c);
void lcd_cmd_byte(byte c);
void lcd_cmd_nibble(byte c);

void lcd_shift_out(byte x);

void lcd_init(void);
void lcd_clr(void);
void lcd_clr_line(byte line);
void lcd_cursor_pos(byte line, byte pos);

void lcd_str(char *s);
void lcd_dec_byte(byte val, byte digits);
void lcd_hex_byte(byte val);
char num_to_char(byte val);
dyeatman



Joined: 06 Sep 2003
Posts: 1923
Location: Norman, OK

View user's profile Send private message

PostPosted: Sun Nov 06, 2005 8:53 am     Reply with quote

Where's the rest of the code?

What version of CCS compiler are you using?

Please post the CCS version and all your code from the beginng to this point...
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Nov 06, 2005 11:07 am     Reply with quote

He's trying to compile Peter H. Anderson's code, here:
http://www.phanderson.com/PIC/PICC/CCS_PCM/24_256_1.html
I was able to get his code to compile by getting rid of the #case
statement. Then it compiled with PCM vs. 3.235 with no errors.


//#case // Comment out this line.
#include <16f84.h>
#include <string.h>
#include <defs_f84.h>
dyeatman



Joined: 06 Sep 2003
Posts: 1923
Location: Norman, OK

View user's profile Send private message

PostPosted: Sun Nov 06, 2005 11:14 am     Reply with quote

Wow! How did you pick up on that?
I have his code here, used it quite a few times and still didn't make the connection. You must work with his code a lot.

Looking at it closely now I can pick up on some of the similarities but it wasn't obvious to me... I'm impressed Exclamation
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Nov 06, 2005 11:22 am     Reply with quote

I have a good memory and I spotted this line as being part of his code:
void delay_10us(byte t);
dyeatman



Joined: 06 Sep 2003
Posts: 1923
Location: Norman, OK

View user's profile Send private message

PostPosted: Sun Nov 06, 2005 11:25 am     Reply with quote

Yeah, that line was the one I finally recognized when I went back and looked at it earlier. That and the comment Peter put in the line following.

Unfortunately my memory just isn't what it used to be. It seems to happen to most of us folks over 50... Good catch!
cuite23



Joined: 02 Nov 2005
Posts: 4

View user's profile Send private message

PostPosted: Tue Nov 08, 2005 3:15 pm     Reply with quote

thank you. I got rid of the #case
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