You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
shundroid edited this page Jul 17, 2016
·
4 revisions
events.on("command", callback)
どれかの Client に対して、有効である command が送られ、実行された時に発生します。
callback の引数:
key (string) : 送信元である Client の Key。
command (string) : コマンド名。ex: roll 、 color
args (Array) : コマンドに対する引数
例:
varspheroWebSocket=require("sphero-websocket");varspheroWS=spheroWebSocket({/* config */});spheroWS.events.on("command",function(key,command,args){console.log("command received from "+key);console.log("orb."+command+"("+args.join(", ");+");");// ex. orb.roll(100, 30)});