WF8266R-8f88d3d2.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 Blink</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>
        document.addEventListener('wf8266r-ready', function (e) {

            setInterval(function(){
                    GPIO.pin(13,2,function(){});
                    GPIO.pin(14,2,function(){});
                    GPIO.pin(15,2,function(){});
                },5000); 
            }, false);
        $(function () {
            //載入 WF8266R 元件
            GPIO.init();
        });
    </script>

</head>
<body>
    <unu-wf8266r ip="mywfXXXX.local" websocket uuid="xxxx" device="xxxx"></unu-wf8266r>
    <wf8266r-button type="gpio" pin="13" value="2">開關1</wf8266r-button>
    <wf8266r-button id="sw1" type="read" pin="13" value="1"></wf8266r-button><br />
    <wf8266r-button type="gpio" pin="14" value="2">開關2</wf8266r-button>
    <wf8266r-button id="sw2" type="read" pin="14" value="1"></wf8266r-button><br />
    <wf8266r-button type="gpio" pin="15" value="2">開關3</wf8266r-button>
    <wf8266r-button id="sw3" type="read" pin="15" value="1"></wf8266r-button><br />
</body>
</html>

請按 RUN 執行