taweili / ardublock

ArduBlock is a Block Programming Language for Arduino.
GNU General Public License v3.0
414 stars 292 forks source link

Error in Arduino code generation. #167

Open tguneysu opened 7 years ago

tguneysu commented 7 years ago

VERSION: ardublock-all-master-beta-20170414.jar

Noticed an error in Arduino code generation. In the picture below, the Ardu blocks used generates the Arduino code below: ardublock_error

include

SoftwareSerial bleShield(10,11); void setup() { bleShield.begin(19200); Serial.begin(9600); }

void loop() { if (bleShield.available()) { Serial.print("message"); Serial.print(" "); bleShield.read()Serial.println(); // <<<--- ERROR in code generation** } } ...AND the line ” bleShield.read()Serial.println();” is wrong in syntax. It should read: Serial.println(bleShield.read());

ALSO:

If the TRUE option is set to FALSE (for new line generation), the following wrong code is generated: void loop() { if (bleShield.available()) { Serial.print("message"); Serial.print(" "); // <<<--- ERROR in code generation
bleShield.read() } // <<<--- ERROR in code generation
}

Thanks to advise.