WF8266R-0c2ed915.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 GPIO Read</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();

            //Read 數位腳位5讀取 型態為 1 : OUTPUT (0:INPUT)
            GPIO.read(5, 1, function(data){
                console.log(data);
            });
        });
    </script>

</head>
<body>
    <unu-wf8266r ip="mywfXXXX.local" websocket uuid="xxxx" device="xxxx"></unu-wf8266r>
    <wf8266r-button id="gpio5" type="read" pin="5" value="1" watch="2000">PIN5 (OUTPUT) </wf8266r-button>
    <wf8266r-button id="gpio4" type="read" pin="4" value="0" watch="2000">PIN4 (INPUT) </wf8266r-button>
</body>
</html>

請按 RUN 執行