3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

mruby on YABMに追加したHTTPサーバのリクエストの利用方法です。

gpioのサブルーチンを含んだファイルと一緒にコンパイルして焼きます。

LEDを点灯するときは

http://10.0.1.111:8080/ctrl?led=on

LEDを消灯するときは

http://10.0.1.111:8080/ctrl?led=off

リクエストが処理されても、パラメータが不正などで処理されなくてもOKが返ります。

LEDの代わりに秋月電子で買えるSSRをつなげばスマートスイッチになります。

mruby on YABMはUDPの受信もできて、これで制御することもできますが、HTTPの方がお手軽です。

3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?