Enable running pde from vs code
This commit is contained in:
parent
039e4758f1
commit
a443b5b412
4 changed files with 114 additions and 10 deletions
41
magic_veneer_processing/.vscode/tasks.json
vendored
Normal file
41
magic_veneer_processing/.vscode/tasks.json
vendored
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
{
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "Run Sketch",
|
||||
"type": "shell",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
"command": "${config:processing.path}",
|
||||
"presentation": {
|
||||
"echo": true,
|
||||
"reveal": "always",
|
||||
"focus": false,
|
||||
"panel": "dedicated"
|
||||
},
|
||||
"args": [
|
||||
"--force",
|
||||
"--sketch=${workspaceRoot}",
|
||||
"--output=${workspaceRoot}/out",
|
||||
"--run"
|
||||
],
|
||||
"windows": {
|
||||
"type": "process",
|
||||
"args": [
|
||||
"--force",
|
||||
{
|
||||
"value": "--sketch=${workspaceRoot}",
|
||||
"quoting": "strong"
|
||||
},
|
||||
{
|
||||
"value": "--output=${workspaceRoot}\\out",
|
||||
"quoting": "strong"
|
||||
},
|
||||
"--run"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -9,17 +9,16 @@ int radius = 0;
|
|||
void setup() {
|
||||
/* Set up screen */
|
||||
fullScreen();
|
||||
background(255);
|
||||
background(0);
|
||||
|
||||
/* Set up communication with arduino */
|
||||
/* 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() {
|
||||
background(255);
|
||||
|
||||
if ( arduinoPort.available() > 0) {
|
||||
println("Test");
|
||||
/* if ( arduinoPort.available() > 0) {
|
||||
String rec = arduinoPort.readStringUntil('\n');
|
||||
if (rec != null) {
|
||||
receivedMessage = rec;
|
||||
|
|
@ -33,5 +32,5 @@ void draw() {
|
|||
|
||||
circle(width / 2, height / 2, radius);
|
||||
fill(0);
|
||||
radius += 10;
|
||||
radius += 10; */
|
||||
}
|
||||
|
|
|
|||
BIN
magic_veneer_processing/out/magic_veneer_processing.class
Normal file
BIN
magic_veneer_processing/out/magic_veneer_processing.class
Normal file
Binary file not shown.
|
|
@ -0,0 +1,64 @@
|
|||
import processing.core.*;
|
||||
import processing.data.*;
|
||||
import processing.event.*;
|
||||
import processing.opengl.*;
|
||||
|
||||
import processing.serial.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.ArrayList;
|
||||
import java.io.File;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class magic_veneer_processing extends PApplet {
|
||||
|
||||
|
||||
|
||||
Serial arduinoPort;
|
||||
String receivedMessage;
|
||||
boolean cameIntoThreshhold = false;
|
||||
|
||||
int radius = 0;
|
||||
|
||||
public void setup() {
|
||||
/* Set up screen */
|
||||
|
||||
background(0);
|
||||
|
||||
/* 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); */
|
||||
}
|
||||
|
||||
public void draw() {
|
||||
println("Test");
|
||||
/* if ( arduinoPort.available() > 0) {
|
||||
String rec = arduinoPort.readStringUntil('\n');
|
||||
if (rec != null) {
|
||||
receivedMessage = rec;
|
||||
}
|
||||
|
||||
// Check for specific events and act upon them
|
||||
if (receivedMessage != null && receivedMessage.contains("isWithinThreshhold")) {
|
||||
cameIntoThreshhold = true;
|
||||
}
|
||||
}
|
||||
|
||||
circle(width / 2, height / 2, radius);
|
||||
fill(0);
|
||||
radius += 10; */
|
||||
}
|
||||
public void settings() { fullScreen(); }
|
||||
static public void main(String[] passedArgs) {
|
||||
String[] appletArgs = new String[] { "magic_veneer_processing" };
|
||||
if (passedArgs != null) {
|
||||
PApplet.main(concat(appletArgs, passedArgs));
|
||||
} else {
|
||||
PApplet.main(appletArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in a new issue