W5V6: Creating Node Red Code for Interfacing with Arduino's

DIY Lab IIT Kharagpur
DIY Lab IIT Kharagpur
0 بار بازدید - 4 سال پیش - Node-RED code for controlling relays
Node-RED code for controlling relays is "https://rb.gy/ndifhp"
Node-RED code for visualising sensor output is "https://rb.gy/a9nm7p"

"Import" these codes from "Node-Red flow editor". To start the flow editor, after you complete installation of Node.js and Node-Red softwares, type "Node-RED" in your terminal window. Once Node-Red server is running, type "http://127.0.0.1:1880" in your browser, e.g. chrome,  and press enter to start the 'Node-Red Flow Editor". Select the correct serial port in each of the codes. See video to know the details.

Code used in "Function" for extracting five entries from a row is

var outputMsgs = [];
var values = msg.payload.trim().split(",");
for(var v in values) {
   outputMsgs.push({payload:values[v]})
}
return outputMsgs;
4 سال پیش در تاریخ 1399/10/08 منتشر شده است.
0 بـار بازدید شده
... بیشتر