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 CCS Technical Support

help me ERROR"Expecting a close paren"

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



Joined: 05 Sep 2011
Posts: 8

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

help me ERROR"Expecting a close paren"
PostPosted: Sat Sep 24, 2011 4:50 am     Reply with quote

Code:
#include <16F877A.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=20000000)
unsigned char DisBuff[5];
unsigned char Scan_Column[]={0xfe,0xfd,0xfb,0xf7,0xff};
unsigned char SegMent_Code[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};

void Decimal_To_7_SegMent(unsigned int16 Num);
void Scan_Display(void);

void main(void)
{
 unsigned int16 Number=0000;
 set_tris_b(0x00);
 set_tris_d(0x00);
 while(true)
 {
  Decimal_To_7_SegMent(Number);
  Scan_Display();
  Number++;
 }
 }
 void Decimal_To_7_SegMent(unsigned int16 Num)
 {
  unsigned int16 temp;
  DisBuff[0]=SegMent_Code[Num/200];
  temp=Num%200;
  DisBuff[1]=SegMent_Code[temp/40];
  temp=Num%40;
  DisBuff[2]=SegMent_Code[temp/6];
  temp=Num%40;
  DisBuff[3]=SegMent_Code[temp];
 }
 void Scan_Display(void)
 {
  int i,j;
  for(i=0;i<5;i++)
  for(j=0;j<4;j++)
  {
   output_b(DisBuff[j]);
   output_d(Scan_Column[j];
   delay_us(200);
    output_b(DisBuff[4]);
   output_d(Scan_Column[4];
   delay_us(200);
  }
 }


Sad Sad Sad
dyeatman



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

View user's profile Send private message

PostPosted: Sat Sep 24, 2011 5:31 am     Reply with quote

output_b(DisBuff[j]);
output_d(Scan_Column[j]; <== Missing )
delay_us(200);
output_b(DisBuff[4]);
output_d(Scan_Column[4]; <== Missing )
delay_us(200);
_________________
Google and Forum Search are some of your best tools!!!!
temtronic



Joined: 01 Jul 2010
Posts: 9226
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sat Sep 24, 2011 6:38 am     Reply with quote

also maybe ...

void main(void)
{
unsigned int16 Number=0000;
set_tris_b(0x00);
set_tris_d(0x00);
while(true)
{
Decimal_To_7_SegMent(Number);
Scan_Display();
Number++;
}
} !!! this could be seen as the end of MAIN ???



Also good idea to put a blank line between functions or blocks of code,easier to read.

And...MPLABv8.66+ has a great feature to highlight the pairs of bracket! Sure makes troubleshooting code easier.
jackhammer



Joined: 05 Sep 2011
Posts: 8

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

PostPosted: Sat Sep 24, 2011 6:45 am     Reply with quote

Thank you very much for all comments Very Happy
jackhammer



Joined: 05 Sep 2011
Posts: 8

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

PostPosted: Sat Sep 24, 2011 9:21 am     Reply with quote

What do you can change code as clock ?
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