-
Code won't compile
Hey guys,
I'm a total beginner when it comes to this stuff. I was given code for a project I'm doing but for some reason it won't compile for me but it compiled for the person that gave it to me. I'm using MPLAB and I get an error message saying 'can't generate code for this expression" and this is the line of code it points to
Code:
if (RA1 ==1 & dutycycle >0)
I was reading up on it and I think it may have something to do with this line being too complicated for the code generator to compile but iI have no idea how to simplify it.
Any help is greatly appreciated.
Thanks guys
-
Try using && instead of &.
--
Mats
-
Thanks for replying so quickly. It didn't like that at all at all!!!
Error [1347] ; 0. can't find 0x70 words (0x70 withtotal) for psect "text80" in segment "CODE" (largest unused contiguous range 0x4A)
-
Code:
if (RA1 == 1 && dutycycle > 0)
is a well-formed C statement, providing RA1 and dutycycle are either variables or constants. So it should be fine if MPLAB uses the C language.