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: EthernetNetIf HTTPServer RPCInterface RemoteIR mbed
Homepage
注:今のところ安定して動作していません。 朝に電源を入れて、夕方にはサーバが死んでいる状況が続いています。 とりあえず、公開していますが原因究明している段階のモノです。
回路図(Circuit)¶
Ethernetのコネクタの周りが適当です。 自分はスイッチサイエンスさんのmbed用イーサネット接続キットを使用して回路を作りました。
HTML¶
このプログラムを使用する際に必要なHTMLです。 mbedにプログラムを書き込む際に同じフォルダ下に入れてください。
html
<html>
<head>
<script src="mbedRPC.js" language="javascript"></script>
<script type="text/javascript">
mbed = new HTTPRPC();
light1 = new RPCFunction(mbed,"light1");
light2 = new RPCFunction(mbed,"light2");
aircon = new RPCFunction(mbed,"aircon");
</script>
</head>
<body>
<br>
<input type="button" name="Light1 ON" value="Light1 ON" onClick="buttonClicked()"><br>
<input type="button" name="Light2 ON" value="Light2 ON" onClick="buttonClicked2()"><br>
<input type="button" name="Air-Con ON" value="Air-Con ON" onClick="buttonClickedAir()"><br>
<script language="javascript">
function buttonClicked(){
/*alert("送信")*/
light1.run(" ");
}
function buttonClicked2(){
/*alert("送信")*/
light2.run(" ");
}
function buttonClickedAir(){
/*alert("送信")*/
aircon.run(" ");
}
</script>
</body>
</html>

