Processing code by Hardik Rathod / hackster.io Modified by Petra Rutanen 5/2023 import meter.*; import processing.serial.*; Serial port; String[] list; Meter m, m2; void setup() { size(950, 400); background(0); port = new Serial(this, "COM10", 9600); fill(120, 50, 0); m = new Meter(this, 25, 100); // Adjust font color of meter value m.setTitleFontSize(20); m.setTitleFontName("Arial bold"); m.setTitle("Temperature (C)"); // Meter Scale String[] scaleLabelsT = {"0", "5", "10", "15", "20" , "25" , "30" , "35" , "40" }; m.setScaleLabels(scaleLabelsT); m.setScaleFontSize(18); m.setScaleFontName("Times New Roman bold"); m.setScaleFontColor(color(200, 30, 70)); m.setArcColor(color(141, 113, 178)); m.setArcThickness(10); m.setMaxScaleValue(80); m.setNeedleThickness(3); m.setMinInputSignal(0); m.setMaxInputSignal(40); // A second meter for reference int mx = m.getMeterX(); int my = m.getMeterY(); int mw = m.getMeterWidth(); m2 = new Meter(this, mx + mw + 20, my); m2.setTitleFontSize(20); m2.setTitleFontName("Arial bold"); m2.setTitle("Humidity (%)"); String[] scaleLabelsH = {"0", "10", "20", "30", "40", "50", "60", "70", "80", "90", "100"}; m2.setScaleLabels(scaleLabelsH); m2.setScaleFontSize(18); m2.setScaleFontName("Times New Roman bold"); m2.setScaleFontColor(color(200, 30, 70)); m2.setArcColor(color(141, 113, 178)); m2.setArcThickness(10); m2.setMaxScaleValue(100); m2.setNeedleThickness(3); m2.setMinInputSignal(0); m2.setMaxInputSignal(100); } public void draw() { textSize(30); fill(0, 255, 0); text("Temperature and Humidity", 270, 50); if (port.available() > 0) { String val = port.readString(); list = split(val, ','); float temp = float(list[0]); float hum = float(list[1]); println("Temperature: " + temp + " C " + "Humidity: " + hum + " %"); m.updateMeter(int(temp)); m2.updateMeter(int(hum)); } }