This is a Json-RPC/2.0 server with websocket and httpd. You can control mbed(s) by Javascript, processing, Java. LPCXpresso1769/LPC1768/FRDM-K64F/LPC4088
Dependencies: NyFileSystems libMiMic mbed-rtos mbed
Fork of MiMicRemoteMCU-for-Mbed by
You are viewing an older revision! See the latest version
Homepage
ベータ版です。I2C/UART等はそのうち実装します。 基本的な使い方はMiMicRemoteMCUと同じです。 バグやごしつもんはtwitterアカウント@nyatlaまでお願いします。
記事書きました。 http://nyatla.hatenadiary.jp/entry/20140625/1403701589
Sample code
callback mode
function start() { var mcu=new mbedJS.Mcu(location.host,{ onNew:function(){ var v=1; var pin=new mbedJS.DigitalOut(mcu,mbedJS.PinName.LED1,{ onNew:function(){ pin.write(1); }, onWrite:function(){ setTimeout(function(){pin.write((v++)%2);},100); }}); }, onError:function(){alert("Error!");} }); }
generator mode
function start() { var g=function*(){ try{ var mcu=new mbedJS.Mcu(location.host,g); yield mcu.waitForNew(); var pin=new mbedJS.DigitalOut(mcu,mbedJS.PinName.LED1,g); yield pin.waitForNew(); for(var v=1;;v++){ yield setTimeout(function(){g.next();},100); yield pin.write(v%2); } }catch(e){ mcu.shutdown(); alert(e); throw e; } }(); g.next(); return; }