View previous topic :: View next topic |
Author |
Message |
cuite23
Joined: 02 Nov 2005 Posts: 4
|
Code Error |
Posted: Sun Nov 06, 2005 8:41 am |
|
|
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); |
|
![](templates/subSilver/images/spacer.gif) |
dyeatman
Joined: 06 Sep 2003 Posts: 1924 Location: Norman, OK
|
|
Posted: Sun Nov 06, 2005 8:53 am |
|
|
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... |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Nov 06, 2005 11:07 am |
|
|
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> |
|
![](templates/subSilver/images/spacer.gif) |
dyeatman
Joined: 06 Sep 2003 Posts: 1924 Location: Norman, OK
|
|
Posted: Sun Nov 06, 2005 11:14 am |
|
|
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](images/smiles/icon_exclaim.gif) |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Nov 06, 2005 11:22 am |
|
|
I have a good memory and I spotted this line as being part of his code:
void delay_10us(byte t); |
|
![](templates/subSilver/images/spacer.gif) |
dyeatman
Joined: 06 Sep 2003 Posts: 1924 Location: Norman, OK
|
|
Posted: Sun Nov 06, 2005 11:25 am |
|
|
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! |
|
![](templates/subSilver/images/spacer.gif) |
cuite23
Joined: 02 Nov 2005 Posts: 4
|
|
Posted: Tue Nov 08, 2005 3:15 pm |
|
|
thank you. I got rid of the #case |
|
![](templates/subSilver/images/spacer.gif) |
|