Display in small window

7 ビュー (過去 30 日間)
Bob Johnson
Bob Johnson 2020 年 6 月 12 日
I save 2 temperature readings every 5 minutes to ThingSpeak and can plot details onto a graph. That works fine. ThingSpeak you are brilliant.......
What I now want is a small box to show the last readings as shown on the enclosed example. This one is made using an excel userform but has drawbacks. The example shows it alongside the taskbar clock which indicates how small it is.
Have tried AutoHotKey which looks the same and works fine but is compiled into an EXE file which has complications in distribution to a small number of users
I am looking for an alternative way to create the box and display data. Have no problem getting the data and parsing it from ThingSpeak using javascript, but am looking for a way to display it. Have 'googled' and come up with topics like headless, JS, CSS but can't find any small projects that I can understand.
Besides the box, I would also like it to be always-on-top, draggable to anywhere on screen and easy to share - ideally with URL link.
Any help would be greatly appreciated. I should image that others would also find this useful
Bob J

回答 (2 件)

Christopher Stapels
Christopher Stapels 2020 年 6 月 15 日
I used appdesigner in MATLAB. I put the following code in the startup function. It updates every 10 seconds. Plus, the window changes color when you tweet a color @cheerlights.
while(1)
data = thingSpeakRead(1417,'outputformat','timetable');
app.Field1ValTextArea.Value = data.LastCheerLightsCommand;
app.Field2ValTextArea.Value = data.CheerLightsHEXColor;
val1= hex2dec(data.CheerLightsHEXColor{1,1}(2:3))/255;
val2= hex2dec(data.CheerLightsHEXColor{1,1}(4:5))/255;
val3= hex2dec(data.CheerLightsHEXColor{1,1}(6:7))/255;
app.UIFigure.Color=[val1,val2,val3];
app.lastUpdate.Text = string(datetime('now'));
pause(10);
drawnow
end

Bob Johnson
Bob Johnson 2020 年 6 月 16 日
Hi Christopher,
Thanks for the response.
That looks ideal. Does app designer need to be downloaded?
I viewed an example video and it doesn't look too difficult.
Thanks again
Bob
  1 件のコメント
Christopher Stapels
Christopher Stapels 2020 年 6 月 16 日
App designer requires a MATLAB license. The MATLAB component that ThingSpeak runs does not support app designer. I should have included that in my original answer.
You can download a trial here.

サインインしてコメントする。

コミュニティ

その他の回答  ThingSpeak コミュニティ

カテゴリ

Help Center および File ExchangeVisualize Data についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by