1. Robin Mitchell

    Thread Starter Well-Known Member

    Oct 25, 2009
    732
    199
    Hi everyone,

    In PIC 18 HI-TEC c MPLAB there are no boolean values. Therefor how can i set up a flag that i can toggle?

    many thanks,
    Robin
     
  2. Robin Mitchell

    Thread Starter Well-Known Member

    Oct 25, 2009
    732
    199
    never mind,

    x ^= 1;

    Switches between 0 and 1
     
  3. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    You can use the #define directive
    Code ( (Unknown Language)):
    1.  
    2.  #define TRUE 1
    3.  #define FALSE 0
    4.  
    Also remember that you can write like this in C
    Code ( (Unknown Language)):
    1.  
    2. [LEFT]if(x)[/LEFT]
    3. count++;
    4.  
    For any non zero value(true) of x the variable count will be incremented. Often very handy. Also read section 3.3 Supported Data Types and Variables. In the manual.
     
Loading...