From 7f6cfebf9853229ca53fe30580b651130beaad87 Mon Sep 17 00:00:00 2001 From: Fisch Date: Tue, 3 Dec 2024 16:49:24 +0100 Subject: [PATCH] add flipdot simulator --- .../mqtt_flipdot_simulator.pde | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 mqtt_flipdot_simulator/mqtt_flipdot_simulator.pde diff --git a/mqtt_flipdot_simulator/mqtt_flipdot_simulator.pde b/mqtt_flipdot_simulator/mqtt_flipdot_simulator.pde new file mode 100644 index 0000000..0e18380 --- /dev/null +++ b/mqtt_flipdot_simulator/mqtt_flipdot_simulator.pde @@ -0,0 +1,65 @@ +import mqtt.*; + +MQTTClient client; + +static int pixeldistance=16; +static int pixelsize=14; +static int displaywidth=75; +static int displayheight=16; +static float pixelcornerradius=3; +static float pixelborderweight=1; + +color colorWhite=color(240,255,150); +color colorBlack=color(50,50,50); + +String lastDataReceived=""; + +PGraphics pg; + +void setup() { + size(1300,300); + pg = createGraphics(int(displaywidth*pixeldistance+pixelborderweight/2),int(displayheight*pixeldistance+pixelborderweight/2)); + background(127); + client = new MQTTClient(this); + client.connect("mqtt://192.168.1.6", "processing-flipdot"); +} + +void draw() { + pg.beginDraw(); + pg.clear(); + for (int y=0;y