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

Error 28 line 15(11,12) Expecting an identifier

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



Joined: 22 Mar 2011
Posts: 7

View user's profile Send private message MSN Messenger

Error 28 line 15(11,12) Expecting an identifier
PostPosted: Wed Mar 23, 2011 3:17 am     Reply with quote

Hi All,

Can somebody help me for this?

I need all of your help about little code below;

Code:
#include <16F877A.h>
#use   delay(CLOCK=4000000)

#fuses XT,NOPUT,NOPROTECT,NOBROWNOUT,NOLVP,NOWDT

#use fast_io(a)
#use fast_io(b)


void main   ()
{
     if(input(pin_d1))
     {
          while(!input(pin_d2)) & (!input(pin_d3))
          {
                output_high(pin_b0);
                delay_ms(100);
                output_low(pin_b0);
                delay_ms(100);
           }
      }
       if(input(pin_d2))
       {
            while(!input(pin_d1)) & (!input(pin_d3))
            {
                output_high(pin_b1);
                delay_ms(100);
                output_low(pin_b1);
                delay_ms(100);
            }
        }
        if(input(pin_d3))
         {
             while(!input(pin_d1)) & (!input(pin_d2))
             {
                output_high(pin_b2);
                delay_ms(100);
                output_low(pin_b2);
                delay_ms(100);
             }
         }
         output_b(0x00);
         while(true);
 }



Error:

Error 28 line 15(11,12) Expecting an identifier


Occurs After:
void main ()
{
if(input(pin_d1))
{
while(!input(pin_d2)) & (!input(pin_d3))


I can find no guidance on how to clear the error.

Thank you

Regards

Rolling Eyes
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Wed Mar 23, 2011 5:44 am     Reply with quote

Basically a C syntax error, missing parenthesis. Also a logical and rather than bitwise and should be used:
Code:
while(!input(pin_d2) && !input(pin_d3))
temtronic



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

View user's profile Send private message

PostPosted: Wed Mar 23, 2011 5:48 am     Reply with quote

Looks as though
main has open and closing bracketsunless I've miscounted, again..!

while(1) doesn't.
------------------------------------

main() ..start of main loop
{
...
{ ..start of while loop
...
...
}
while(true); end of while loop
} //end of main loop
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