Add test shape

This commit is contained in:
Dennis Schoepf 2020-09-17 14:04:34 +02:00
parent 6bb22a78db
commit 6db53bfdee

View file

@ -4,12 +4,21 @@ Serial arduinoPort;
String receivedMessage; String receivedMessage;
boolean cameIntoThreshhold = false; boolean cameIntoThreshhold = false;
int radius = 0;
void setup() { 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); arduinoPort = new Serial(this, portName, 9600);
} }
void draw() { void draw() {
background(255);
if ( arduinoPort.available() > 0) { if ( arduinoPort.available() > 0) {
String rec = arduinoPort.readStringUntil('\n'); String rec = arduinoPort.readStringUntil('\n');
if (rec != null) { if (rec != null) {
@ -21,4 +30,8 @@ void draw() {
cameIntoThreshhold = true; cameIntoThreshhold = true;
} }
} }
circle(width / 2, height / 2, radius);
fill(0);
radius += 10;
} }