I am trying to shorten my code so I just tested this snippet of code as an alternative to using the "standard if/else statement.
The code executes correctly so it appears the syntax is valid.
However, it takes a long time to compile.
int a = HIGH;
int b = LOW;
bool c;
bool d;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
while(!Serial);
if (a == b) c = true;
else c = false;
Serial.println(c);
d = (a == HIGH) ? true : false;
Serial.println(d);
}
void loop() {
// put your main code here, to run repeatedly:
}
Just wondering if there are any known issues using the above if statements.
PaulS:
It took less than 10 seconds when I compiled it. Since you didn't mention which Arduino, which version of the IDE, or which OS, I won't, either.
lol PaulS from reading so many of your posts, I can appreciate your sometimes twisted sense of humour.
FWIW IDE 1.6.5 r2, Windows 7 Professional, Uno.
Compiled again - this time it took 22 seconds. Before definitely more than at least 30 seconds.