This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Ensure we have a default reading | |
lastreading <- { "pm10":0, "pm25":0, "pm100":0 }; | |
// Code to convert particlate density to AQI index | |
// based on https://gist.github.com/kfury/822bbba2cb0f946abb73baa156722ab1 | |
function Linear(AQIhigh, AQIlow, Conchigh, Conclow, Conc) { | |
local a=((Conc-Conclow)/(Conchigh-Conclow))*(AQIhigh-AQIlow)+AQIlow; | |
return math.floor(a+0.5); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<a href="https://drive.google.com/uc?export=view&id=XXX"><img src="https://drive.google.com/uc?export=view&id=XXX" style="width: 500px; max-width: 100%; height: auto" title="Click for the larger version." /></a> |