Skip to content
Snippets Groups Projects
Verified Commit 60d6dd81 authored by Anian Bühler's avatar Anian Bühler
Browse files

optimized SerialPrintLn block

parent 63ae5814
No related branches found
No related tags found
1 merge request!2Dev preferences
......@@ -40,18 +40,13 @@ public class SerialPrintBlock extends TranslatorBlock
stringParts[i] = stringParts[i].substring(0,stringParts[i].length() - 1) + " \"";// SPACE added at the end of every part
}
if(newLine.equals("true")||newLine.equals("HIGH")){
if((newLine.equals("true")||newLine.equals("HIGH")) && i == stringParts.length-1){ // Add \n if last SerialPrint & newline is true
ret += "Serial.println(" + stringParts[i] + ");\n";
}else {
ret += "Serial.print(" + stringParts[i] + ");\n";
}
}
return ret;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment