Go Down

Topic: VirtualWire (Read 3 times) previous topic - next topic

PaulS

Quote
--> this is example of boolean variable which will return either true or false.

No, that is an example of two int (I'm assuming) values being compared. Comparing boolean variables using > doesn't make sense.

Quote
--> This is non boolean variable..

The statement itself does not provide enough information to answer the question. What is the type of variable? That is what determines how to write the statement. It doesn't make sense to compare a boolean variable (containing true or false) to HIGH or LOW. So, it appears that the statement does not involve a boolean variable.

Vincent19

Can you give me some simple example to illustrate that ?

Thanks

PaulS

Quote
Can you give me some simple example to illustrate that ?

Can you learn to ask better questions? To illustrate what?

Vincent19

Illustrate the difference between boolean variable and non-boolean variable :D

PaulS

Quote
Illustrate the difference between boolean variable and non-boolean variable

Code: [Select]
boolean dense = false;
if(!dense)
{
   byte IQ = 14;
   byte min = 100;
   if(IQ > min)
   {
      // Smart enough
   }
   else
      dense = true;
}

Go Up