[Solved] Compilation failed in xc8 for 12f675

Submitted by lara on Fri, 10/05/2018 - 20:11

hi there,

I am using 12f675/ xc8 compiler. input pin will monitor the count with the code-

"for(Count=0; Count < 10; Count++) 
        {
        while(Input == 1);

         }"

but during compile build fail with warning

" 675 .c:65: error: (195) expression syntax
  675 .c:65: error: (194) ")" expected

"

 

It is observed when Input==1 is closed with double inv. comma like  //while("Input == 1")//  then the code is build .

so what is difference in between both of them with double invited comma and without it??

tnx

Hi Lara, welcome to circuitdigest Forums.

It is observed when Input==1 is closed with double inv. comma like  //while("Input == 1")//  then the code is build .

so what is difference in between both of them with double invited comma and without it??

When you use something inside two quotes "Input==1" like this, then it is considered as a string. A while loops condition statement should have a condition side it using a string might not give you compile time error, but it has no logic behind it hence cannot be used.

 

"for(Count=0; Count < 10; Count++) 
        {
        while(Input == 1);

         }"

It is difficult to tell you why exactly the error is popping up since you have not given the complete. From the snippet you have given the line while(Input==1); seems odd.

while(Input==1);

will check if the variable Input is high or low, and if high it will get into the while statement and will remain there forever. Because the variable Input will never be updated again unless there is an interrupt function somewhere in the program and the ISR updates the values of Input variable using 

while(Input==1); is equivalent to while(1);

 

  Joined August 16, 2016      998
Tuesday at 12:29 AM

Tnx Raj sir for you reply I got understand the matter..

Now I want to reduce component like resistor length in Schematic Capture and PCB Layout also in Labcentre Proteus 8.6 Application. For that, I have decomposed the resistor(RES40) and after changing its width from 0.3in to 0.2in and its reduced size is shown in Schematis Capture BUT,

When coming to PCB Layout it is shown the width of 0.3in as like RES40.

Please let me know how do i get the reduced size in PCB Layout too.

Is there any library file for various length/width resistor which can be  added to the "Library" folder of Proteusto get less width/length's resistors.

tnx.

  Joined October 05, 2018      8
Friday at 07:49 PM

I am not a big fan of Proteus for PCB layouts. I use EasyEDA and has been very user friendly so far.

Also since you previous problem is solved, It is a better practice to start a new thread (new question) for your other doubts.

Thanks

  Joined August 16, 2016      998
Tuesday at 12:29 AM

ok thanks Raj sir

  Joined October 05, 2018      8
Friday at 07:49 PM