Show minor edits - Show changes to markup
The Arduino language (based on Wiring) is implemented in C, and therefore has some differences from the Processing language, which is based on Java.
The Arduino language (based on Wiring) is implemented in C/C++, and therefore has some differences from the Processing language, which is based on Java.
(:cellnr:) printString("hello world");
printNewline();
(:cellnr:) Serial.println("hello world");
(:cellnr bgcolor=#999999:) int i = 5;
printInteger(i);
printNewline();
(:cellnr bgcolor=#999999:) int i = 5;
Serial.println(i);
(:cellnr:) int i = 5;
printString("i = ");
printInteger(i);
printNewline();
(:cellnr:) int i = 5;
Serial.print("i = ");
Serial.print(i);
Serial.println();
The Arduino language (based on Wiring) is implemented in C, and therefore has some differences from the Processing language, which is based on Java.
(:table width=75% cellspacing=0 cellpadding=5:)
(:cellnr width=50% bgcolor=#999999:) Arduino
(:cell width=50% bgcolor=#CCCCCC:) Processing
(:cellnr:) int bar[8];
bar[0] = 1;
(:cell:) int[] bar = new int[8];
bar[0] = 1;
(:cellnr bgcolor=#999999:) int foo[] = { 0, 1, 2 };
(:cell bgcolor=#CCCCCC:) int foo[] = { 0, 1, 2 };
or
int[] foo = { 0, 1, 2 };
(:tableend:)
(:table width=75% cellspacing=0 cellpadding=5:)
(:cellnr width=50% bgcolor=#999999:) Arduino
(:cell width=50% bgcolor=#CCCCCC:) Processing
(:cellnr:) int i;
for (i = 0; i < 5; i++) { ... }
(:cell:) for (int i = 0; i < 5; i++) { ... }
(:tableend:)
(:table width=75% cellspacing=0 cellpadding=5:)
(:cellnr width=50% bgcolor=#999999:) Arduino
(:cell width=50% bgcolor=#CCCCCC:) Processing
(:cellnr:) printString("hello world");
printNewline();
(:cell:) println("hello world");
(:cellnr bgcolor=#999999:) int i = 5;
printInteger(i);
printNewline();
(:cell bgcolor=#CCCCCC:) int i = 5;
println(i);
(:cellnr:) int i = 5;
printString("i = ");
printInteger(i);
printNewline();
(:cell:) int i = 5;
println("i = " + i);
(:tableend:)