Hi,
I’m trying out mBlock for the first time. I added a forever loop with a single dummy statement (set pin 9 high), connected to “when Arduino starts up”. I was surprised to see that all the code was generated in setup():
void setup() {
pinMode(9,OUTPUT);
while(1) {
digitalWrite(9,1);
_loop();
}
}
void _loop() {
}
void loop() {
_loop();
}
I would have expected something more like:
void setup() {
pinMode(9, OUTPUT);
}
void loop() {
digitalWrite(9, 1);
}
Is there something that I’m missing in order to get code to be added to loop()? I did find another thread here where someone was seeing no code in loop() (mBot code in setup() and no code in the loop()), but in that case it was because they were using a finite “repeat” block rather than “forever”, which makes sense.
I’m using mBlock 5.1.0 on Mac OS X 10.14.6 with an Arduino Mega2560.
Thanks!