system
1
I am reading a digitalpin into a boolean value and then I not it and it becomes an integer value.
boolean sensorValue = digitalRead(2); // returns 0 or 1
sensorValue =~ sensorValue; // Not operation and value becomes 255 or 254
I was hoping it would inverse the values, 0 would become 1 and 1 would become 0
Ladies and gentlemen, the competition for the forum's shortest post is now over.
system
4
Woops, I was doing a bitwise
sensorValue =! sensorValue;
Totally works.
Thanks AWOL
LOL Wildbill, I guess it could only be outed by a null response.
system
5
I nearly wrote
!, !~
But I thought that too obscure.
The "!!" operation is useful for converting to a boolean.
wildbill:
Ladies and gentlemen, the competition for the forum's shortest post is now over.
LOL, and in the best tradition of the C language, short, concise, and very obscure.
Lefty