Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
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;
}
