29 lines
491 B
Plaintext
29 lines
491 B
Plaintext
|
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);
|
||
|
|
||
|
}
|