<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Average statistical function]]></title><description><![CDATA[<p dir="auto">Hi, I am using the following to get the temp from an NTC</p>
<pre><code>T = t1.past(MINUTE).average;

THERMISTORNOMINAL = 10000;

 // temp. for nominal resistance (almost always 25 C)
TEMPERATURENOMINAL = 25;

// The beta coefficient of the thermistor (usually 3000-4000)
BCOEFFICIENT = 3435;

// the value of the 'other' resistor
SERIESRESISTOR = 14910;

average = 1023.00 / T  - 1.00;

average = SERIESRESISTOR / average;

steinhart = average / THERMISTORNOMINAL; // (R/Ro)
steinhart = Math.log(steinhart); // ln(R/Ro)
steinhart /= BCOEFFICIENT; // 1/B * ln(R/Ro)
steinhart += 1.0 / (TEMPERATURENOMINAL + 273.15); // + (1/To)
steinhart = 1.0 / steinhart; // Invert
steinhart -= 273.15; // convert to C

return steinhart ;
</code></pre>
<p dir="auto">Trouble is that  when even for the past one hour where there is **NO **t1 value received, the average function still returns the average based on whatever was stored earlier. I was expecting that in case of no data, the average function based on time would return a NULL.</p>
<p dir="auto">Any thoughts / suggestions ?</p>
]]></description><link>https://forum.mango-os.com/topic/1314/average-statistical-function</link><generator>RSS for Node</generator><lastBuildDate>Tue, 08 Sep 2026 06:57:23 GMT</lastBuildDate><atom:link href="https://forum.mango-os.com/topic/1314.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 04 Apr 2013 21:09:43 GMT</pubDate><ttl>60</ttl></channel></rss>