From a443b5b4125cdd14daca77c58f27d3756be8a183 Mon Sep 17 00:00:00 2001 From: Dennis Schoepf Date: Mon, 21 Sep 2020 12:03:05 +0200 Subject: [PATCH] Enable running pde from vs code --- magic_veneer_processing/.vscode/tasks.json | 41 +++++++++++ .../magic_veneer_processing.pde | 19 +++--- .../out/magic_veneer_processing.class | Bin 0 -> 1167 bytes .../out/source/magic_veneer_processing.java | 64 ++++++++++++++++++ 4 files changed, 114 insertions(+), 10 deletions(-) create mode 100644 magic_veneer_processing/.vscode/tasks.json create mode 100644 magic_veneer_processing/out/magic_veneer_processing.class create mode 100644 magic_veneer_processing/out/source/magic_veneer_processing.java diff --git a/magic_veneer_processing/.vscode/tasks.json b/magic_veneer_processing/.vscode/tasks.json new file mode 100644 index 0000000..6e22ba9 --- /dev/null +++ b/magic_veneer_processing/.vscode/tasks.json @@ -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" + ] + } + } + ] +} diff --git a/magic_veneer_processing/magic_veneer_processing.pde b/magic_veneer_processing/magic_veneer_processing.pde index ee12aae..fbb85f0 100644 --- a/magic_veneer_processing/magic_veneer_processing.pde +++ b/magic_veneer_processing/magic_veneer_processing.pde @@ -9,29 +9,28 @@ int radius = 0; void setup() { /* Set up screen */ fullScreen(); - background(255); - - /* Set up communication with arduino */ + 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); + 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; } - + // 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; + radius += 10; */ } diff --git a/magic_veneer_processing/out/magic_veneer_processing.class b/magic_veneer_processing/out/magic_veneer_processing.class new file mode 100644 index 0000000000000000000000000000000000000000..597b1f97c25a883c9acc8de0f7010ea6d972819c GIT binary patch literal 1167 zcmX^0Z`VEs1_omW8+HaJMh5ZR#PrPM__EZz)YPK*f};H7)Z*gIymWR37Dfhf1YbWn zzbI8dz_FkpC$)r;fjhA%r8F}yKOn!TgponY2T5UZYEfolj(#whvSwu9FG@{L%`8hz z@l7o*PE1c_WDxSnN-Rs%&q>Tn*AFf!%FIi*W@HdbPRvd9%qz(c$tX%K&dA8mNnvDQ zjACS9D@shsEG=eaVDw~UV6(~0%Pg^DWMJ0N3}a+qan4UkMMege zkksN5kaA@n1{DTXMh5nRqRhOKoIFMbQ4P#M0BPnZPAw_P%u6o@Y180g&}86aWZ+6G z&B+N)E=o`-1iVTbl%nS?+EDQ_`tPE@nAi&PR0ir;0 z52m>pc)+rZpmf2&$iUCQz~IWj#K6eFz`(Dyok2j0c`Jhuh!EMxz`(%7AjZJJAOtp2 zkb#9koPm=;l7WvwkU^Y*fq@62jX{Dzl7WGNkwJ=q4{D?d)JQfh=4}kp2$Q%Nm>3us zIehaz{Z** zX=a65&k2e&s0T_JSRhVi*~_34$t 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); + } + } +}