Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- msg_receive0
- -- ワイヤレス通信メッセージを受信する(受信側プログラム)
- local mon = peripheral.wrap("top") -- 上側のモニターを使います宣言
- rednet.open("right") -- 右側のモデムを使います宣言
- while true do
- local id, msg = rednet.receive() -- メッセージを受信するまで待ち続ける
- print(id, msg) --送信元IDとメッセージをターミナル画面に表示
- mon.clear() -- モニターの表示リセット
- mon.setCursorPos(1,1) -- モニターのカーソル位置初期化
- mon.write(msg) -- 受信したメッセージを表示
- end
Add Comment
Please, Sign In to add comment