خرید بک لینک

Vote count: 0

have node-red ruing with arduino analogue output through serial to pi, where I'm collecting thermistor data as a msg payload on change.

Trying to tu the Arduino signal into a Temperature - it's the most common 10K enamelised thermistor that adafruit sell. So quite useful code.

The issue is that I am a total noob at JS.

Here's my code so far - using a function node - and trying to replicate the steinhart equation (https://lea.adafruit.com/thermistor/using-a-thermistor)

 var input = { payload: msg.payload };
var R0 = 10000;
var R = R0 / ((1023 / input)-1);
var T0 = 273 + 25;
var B = 3950;
var T =  1 / ( (1/T0) + (1/B) * Math.log(R/R0) );
retu T;

asked 39 secs ago

- - , .

برچسب: نویسنده: استخدام کار تاريخ: يکشنبه 25 بهمن 1394 ساعت: 0:12

صفحه بندی