WF8266R-878dc8be.html 注意:線上實作平台僅供練習, 程式請自行下載留存, 不定期會清空

<!doctype html>
<html>
<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
    <title>WF8266R.js G3 G5 PM25</title>

    <!-- Imports WF8266R -->
    <script src="http://wf8266.com/wf8266r/webcomponent/jquery-2.1.4.min.js"></script>
    <script src="http://wf8266.com/wf8266r/webcomponent/wf8266r/wf8266r.js"></script>
    <link href="http://wf8266.com/wf8266r/webcomponent/wf8266r/wf8266r.css" rel="stylesheet" />

    <script>
        $(function () {
            //載入 WF8266R 元件
            GPIO.init();

            setInterval(function(){
                GPIO.pm25g(function(data){
                    //{"PMCF10":34,"PMCF25":50,"PMCF100":54,"PMAT10":27,"PMAT25":40,"PMAT100":50,"PMCount03":1614,"PMCount05":24,"PMCount10":28928,"PMCount25":639,"PMCount50":16973,"PMCount100":20}
                    $("#cf10").text(data.PMCF10);
                    $("#cf25").text(data.PMCF25);
                    $("#cf100").text(data.PMCF100);
                    $("#at10").text(data.PMAT10);
                    $("#at25").text(data.PMAT25);
                    $("#at100").text(data.PMAT100);
                    $("#c03").text(data.PMCount03);
                    $("#c05").text(data.PMCount05);
                    $("#c10").text(data.PMCount10);
                    $("#c25").text(data.PMCount25);
                    $("#c50").text(data.PMCount50);
                    $("#c100").text(data.PMCount100);
                });
                },2000); //試著改改時間 1 秒 = 1000
        });
    </script>

</head>
<body>
    <unu-wf8266r ip="mywfXXXX.local" uuid="xxxx" device="xxxx"></unu-wf8266r>
    CF10 : <span id="cf10"></span><br /><br />
    CF25 : <span id="cf25"></span><br /><br />
    CF100 : <span id="cf100"></span><br /><br />
    AT10 : <span id="at10"></span><br /><br />
    AT25 : <span id="at25"></span> ug/m3<br /><br />
    AT100 : <span id="at100"></span><br /><br />
    Count03 : <span id="c03"></span><br /><br />
    Count05 : <span id="c05"></span><br /><br />
    Count10 : <span id="c10"></span><br /><br />
    Count25 : <span id="c25"></span><br /><br />
    Count50 : <span id="c50"></span><br /><br />
    Count100 : <span id="c100"></span>
</body>
</html>

請按 RUN 執行