From c0a4e41bff3ec7c2d1517190e1ad75bbce287eb2 Mon Sep 17 00:00:00 2001 From: Fisch Date: Thu, 27 Dec 2018 15:08:41 +0100 Subject: [PATCH] add spout --- lichtschranke/speedshow/speedshow.pde | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/lichtschranke/speedshow/speedshow.pde b/lichtschranke/speedshow/speedshow.pde index 0b7147f..df43335 100644 --- a/lichtschranke/speedshow/speedshow.pde +++ b/lichtschranke/speedshow/speedshow.pde @@ -3,6 +3,13 @@ import java.io.FileWriter; import java.io.*; import java.util.*; +import spout.*; + +boolean spoutactive=true; + +Spout spout; + + PFont fontregular; PImage image_line; @@ -58,6 +65,12 @@ void setup() { pw=createWriter("speeds.txt"); background(0); + + + if (spoutactive){ + spout=new Spout(this); + spout.createSender("Spout Processing"); + } } @@ -82,7 +95,6 @@ void draw() { pw.flush(); unitdisplay=int(random(0,unitdisplay_count)); - unitdisplay=1; println("unitdisplay: "+unitdisplay); triggerspeedmin=getTimesPercentile(0.8); @@ -121,7 +133,7 @@ void draw() { text(nf(speedfloat*0.539957,1,2) + " knots" , xtext, ytext); break; case 6: - text(nf(speedfloat*1079000000,1,0) + " c" , xtext, ytext); + text(nf(speedfloat*0.000000000926567,1,9) + " c" , xtext, ytext); break; case 7: text(nf(speedfloat*54.67469,1,0) + " ft/min" , xtext, ytext); @@ -154,6 +166,9 @@ void draw() { text( "speed trap: "+nf(triggerspeedmin,1,1) +" km/h", 10, height-50); + if (spoutactive){ + spout.sendTexture(); + } }