Skip to content

Commit 0b8745b

Browse files
committed
trycatch arduino comms
1 parent 9eecd83 commit 0b8745b

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

ScoreWindow/RefPWindow.pde

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ class refPWindow extends PApplet {
161161
fill(160);
162162
}
163163
rect(width*(.4+.05), height*(.8+.1), width*.04, height*.09);
164+
rectMode(CORNER);
164165
}
165166
}
166167

ScoreWindow/ScoreWindow.pde

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,12 @@ void settings() {
8888
void setup() {
8989
refWin=new refPWindow();
9090
frameRate(100);
91-
myPort=new Serial(this, serialPort, 250000);
91+
try {
92+
myPort=new Serial(this, serialPort, 250000);
93+
}
94+
catch(RuntimeException e) {
95+
println("WARNING: FIELD ARDUINO DISCONNECTED");
96+
}
9297
}
9398

9499
void serialEvent(Serial p) {

0 commit comments

Comments
 (0)