Add test shape
This commit is contained in:
parent
6bb22a78db
commit
6db53bfdee
1 changed files with 14 additions and 1 deletions
|
|
@ -4,12 +4,21 @@ Serial arduinoPort;
|
|||
String receivedMessage;
|
||||
boolean cameIntoThreshhold = false;
|
||||
|
||||
int radius = 0;
|
||||
|
||||
void setup() {
|
||||
String portName = Serial.list()[Serial.list().length - 1]; //change the 0 to a 1 or 2 etc. to match your port
|
||||
/* Set up screen */
|
||||
fullScreen();
|
||||
background(255);
|
||||
|
||||
/* Set up communication with arduino */
|
||||
String portName = Serial.list()[Serial.list().length - 1]; //change index to match your port
|
||||
arduinoPort = new Serial(this, portName, 9600);
|
||||
}
|
||||
|
||||
void draw() {
|
||||
background(255);
|
||||
|
||||
if ( arduinoPort.available() > 0) {
|
||||
String rec = arduinoPort.readStringUntil('\n');
|
||||
if (rec != null) {
|
||||
|
|
@ -21,4 +30,8 @@ void draw() {
|
|||
cameIntoThreshhold = true;
|
||||
}
|
||||
}
|
||||
|
||||
circle(width / 2, height / 2, radius);
|
||||
fill(0);
|
||||
radius += 10;
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue