From e6257361975243895d6ec36a7a150f69832bc096 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Ple=C3=9F?= Date: Sat, 29 Dec 2018 19:41:35 +0100 Subject: [PATCH] added display sketch --- lichtschranke/raspidisplay/raspidisplay.pde | 29 +++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 lichtschranke/raspidisplay/raspidisplay.pde diff --git a/lichtschranke/raspidisplay/raspidisplay.pde b/lichtschranke/raspidisplay/raspidisplay.pde new file mode 100644 index 0000000..76b3c74 --- /dev/null +++ b/lichtschranke/raspidisplay/raspidisplay.pde @@ -0,0 +1,29 @@ +import processing.net.*; + +Client myClient; +String dataIn; + +void setup() { + size(800, 480); + myClient = new Client(this, "151.217.154.23", 2323); + background(0); + dataIn = "23.23"; +} + +void draw() { + background(0); + + if (myClient.available() > 0) { + dataIn = myClient.readString(); + } + + textSize(210); + float w = textWidth(dataIn); + + text(dataIn, (width-w)/2, height/2); + + textSize(80); + w = textWidth("km/h"); + text("km/h", (width-w)/2, height - 60); + +} \ No newline at end of file