Sensor output data

144 views
Skip to first unread message

GAMA

unread,
Jul 30, 2020, 1:16:36 AM7/30/20
to Smoothie Charts
Hey! I am newbie here, want to show the output data of sensor just using webviewstring as following-

series.append(new Date().getTime(), datas);
var datas = window.AppInventor.getWebViewString() ;

But it's not working for me. Please guide me.

Derek Brookes

unread,
Aug 31, 2021, 4:40:55 AM8/31/21
to Smoothie Charts
for example to produce a  squarewave (a new frequency set by the webviewstring each time the browser is refreshed) I did this:

var lowValue = 15,
    highValue = 19,
    value = lowValue;

var myTime= window.AppInventor.getWebViewString();

setInterval(function()
{
    var t = new Date().getTime();
    timeSeries.append(t, value);
    
    value = value === lowValue ? highValue : lowValue;

}, myTime);

hope it helps
Reply all
Reply to author
Forward
0 new messages