Multiple Google gauges?

Beng Choon Chua am 24 Mär. 2022
Letzte Aktivität Bearbeitung durch Christopher Stapels am 29 Mär. 2022

I have a google gauge that shows my PM2.5 sensor values but I would like to make 3 gauges appear side by side that show the value of different sensors. How can I do that? Thanks

Christopher Stapels
Christopher Stapels am 24 Mär. 2022 (Bearbeitet am 24 Mär. 2022)

You can create a custom MATLAB visualization with your gauges.

I've made a gage with ploarplot where theta is the value you want to show. Here is some code to get you started.

f=tiledlayout(1,3);
nexttile(f);
rho = linspace(1,10,5);
theta = 3/4*pi*ones(1,5);
myLineWidth = 4;
polarplot(theta,rho,'LineWidth',myLineWidth)
nexttile(f);
polarplot(theta*1.5,rho,'k','LineWidth',myLineWidth);
nexttile(f);
polarplot(theta*2.5,rho,'r','LineWidth',myLineWidth);
Beng Choon Chua
Beng Choon Chua am 29 Mär. 2022 (Bearbeitet am 29 Mär. 2022)

Thank you, but do you know how to implement it on google gauge?

Or is there any way to make 3 widgets appear in one window, side by side? The reason why I dont use polarplot is because I want to show my sensor values which are not in degree

Christopher Stapels
Christopher Stapels am 29 Mär. 2022 (Bearbeitet am 29 Mär. 2022)

You can scale the sensor values by the degrees in a circle. If you gauge has a total range of 100, and value= measurement then the position of the line in degrees is

position = 360/100* measurement

or in radians

position = 2* pi()/100 * measurement

In fact, you can make a function that creates the plots that takes in the current measurement and the gauge range as arguments and then generates the output. You can read the present value from you channel using thingSpeakRead.

Beng Choon Chua
1
Veröffentlichen
1
Antworten

Tags

Noch keine Tags eingegeben.