使用 MacBook + Node.js + Web BlueTooth + BLE 來玩 micro:bit (Part III)

完成了Part I, II 的 [事前準備] ... [網頁測試(日本範例)] ... 接下來就簡單了...

當然是回到初衷,先來看看新加坡朋友的示範影片...如下

作者也在影片下方註明了執行環境 ( https://www.youtube.com/watch?v=XEFl0JMgbag&feature=youtu.be ) 
Here is the demo of web bluetooth with microbit. On the server is the Ubuntu hosting the web app and on the client is the Chrome Browser running on Samsung Android 6.
示意圖,如下


雖然,我沒有 Ubuntu Laptop當Server,改用 MacBook Pro 取代,以下是實作過程...

先到github網站 https://github.com/ferrygun/microbit-led 下載源碼,如下圖


進入 microbit-led 目錄,查看一下有那些檔案,如下圖

看到目錄內沒有 .js 表示作者將 javascript 寫在 .html 中,如 Part II 的方式,直接啟用 python SimpleHTTPServer,如下圖

打開 Chrome瀏覧器,即可操作了,如下圖


示範影片,如下

另外,若要在 Windows10 上執行請參攷 Part II,在此僅擷圖如下


在 Android 6.0手機 上應該也可以,但因我的是 5.0 就不試了!!

總之,在作者的 github Repository 中 ( https://github.com/ferrygun?tab=repositories ) 還有許多好玩的例子可以玩,留給各位看倌自行研究了...

就這樣...迷迷糊糊六天虛擲的結果就是--可以透過 Node.js + Web BlueTooth + BLE 來玩 micro:bit ...#The End.

其實,
micro:bit 只是個MCU小板子,
如何寫出應用程式才是重點?!
如何做生活應用或STEAM教育也是重點?!

下一步,就來玩一玩 ARM mbed OS 的 core核心 C++ 程式吧...

留言