Skip to content

Commit 017326a

Browse files
committed
Minor changes to Communication Examples
Added a note to the included Processing sketches about replacing println(Serial.list()) with Serial.printArray() if using Processing 2.1 or later
1 parent a432e26 commit 017326a

File tree

6 files changed

+11
-1
lines changed

6 files changed

+11
-1
lines changed

build/shared/examples/04.Communication/Dimmer/Dimmer.ino

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ void loop() {
5555
size(256, 150);
5656
5757
println("Available serial ports:");
58+
// if using Processing 2.1 or later, use Serial.printArray()
5859
println(Serial.list());
5960
6061
// Uses the first port in this list (number 0). Change this to

build/shared/examples/04.Communication/Graph/Graph.ino

+4
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,17 @@ void loop() {
6363
size(400, 300);
6464
6565
// List all the available serial ports
66+
// if using Processing 2.1 or later, use Serial.printArray()
6667
println(Serial.list());
68+
6769
// I know that the first port in the serial list on my mac
6870
// is always my Arduino, so I open Serial.list()[0].
6971
// Open whatever port is the one you're using.
7072
myPort = new Serial(this, Serial.list()[0], 9600);
73+
7174
// don't generate a serialEvent() unless you get a newline character:
7275
myPort.bufferUntil('\n');
76+
7377
// set inital background:
7478
background(0);
7579
}

build/shared/examples/04.Communication/PhysicalPixel/PhysicalPixel.ino

+1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ void loop() {
8484
// You will need to choose the port that the Arduino board is
8585
// connected to from this list. The first port in the list is
8686
// port #0 and the third port in the list is port #2.
87+
// if using Processing 2.1 or later, use Serial.printArray()
8788
println(Serial.list());
8889
8990
// Open the port that the Arduino board is connected to (in this case #0)

build/shared/examples/04.Communication/SerialCallResponse/SerialCallResponse.ino

+2-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ void setup() {
9292
xpos = width/2;
9393
ypos = height/2;
9494
95-
// Print a list of the serial ports, for debugging purposes:
95+
// Print a list of the serial ports for debugging purposes
96+
// if using Processing 2.1 or later, use Serial.printArray()
9697
println(Serial.list());
9798
9899
// I know that the first port in the serial list on my mac

build/shared/examples/04.Communication/SerialCallResponseASCII/SerialCallResponseASCII.ino

+1
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ void setup() {
9191
size(640,480);
9292
9393
// List all the available serial ports
94+
// if using Processing 2.1 or later, use Serial.printArray()
9495
println(Serial.list());
9596
9697
// I know that the first port in the serial list on my mac

build/shared/examples/04.Communication/VirtualColorMixer/VirtualColorMixer.ino

+2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ void loop()
5050
size(200, 200);
5151
5252
// List all the available serial ports
53+
// if using Processing 2.1 or later, use Serial.printArray()
5354
println(Serial.list());
55+
5456
// I know that the first port in the serial list on my mac
5557
// is always my Arduino, so I open Serial.list()[0].
5658
// Open whatever port is the one you're using.

0 commit comments

Comments
 (0)