<when on board button pressed?> code does not compile


#1

In mBlock 5
image
gives c code
void setup(){
pinMode(A7,INPUT);
while(!((null^(analogRead(A7)>10?0:1)))){}

In mblock 3 it compiles as in the last line null is a 0
void setup(){
pinMode(A7,INPUT);
while(!((0^(analogRead(A7)>10?0:1))))
{
_loop();
}
}

As the compiler messages are in Chinese I cannot tell why but my guess is null is not defined.

This is an important bug to fix as in classrooms we use the wait for on-board button to be pressed a lot to prevent unwanted student robot interactions.


#2

Hi mjbaynes,
In mBlock 5, I wrote same program and copied Arduino C codes and pasted in Arduino IDE (1.6.5), it compiled successfully. Same result in mBlock 3.
Would you please take a screen shot of that? Whole page please.


#3

Offending line is 39 in attached screenshot


version


#4

Thanks for the explanation. And we checked that it is a bug when we use non-Chinese.
Sorry for the trouble caused. We will fix it in the next mBlock 5.