当 node-red 中的值低于 1 时,条形消失

问题描述 投票:0回答:0

在红色节点上,我有一个条形图,表示由 Raspberry Pi 管理的压力传感器的值。在终端上,当压力低于 1 巴时一切正常,但在红色节点上,如果传感器 1 低于 1,它的条就会消失。

我认为这可能是因为我用来调整值以将它们放入图表中的代码:

const Press = msg.payload.trim().slice(1,-1).split(" ");

i=0;
y=1;
for (const element of Press) {
    msg.topic = "P"+y;
    msg.payload=Press[i]/1e5;
    node.send(msg);
    i++;
    y++;

}


return;

我真的不知道,因为我不是节点专家

python charts raspberry-pi node-red
© www.soinside.com 2019 - 2024. All rights reserved.