Added collision event to the messages example and updated collision example.
This commit is contained in:
parent
507e381ae6
commit
517a093604
|
@ -18,11 +18,10 @@ Cylon.robot
|
|||
)
|
||||
|
||||
me.sphero.on 'collision', (data) ->
|
||||
me.sphero.setRGB(color)
|
||||
Logger.info 'collision:'
|
||||
console.log("color: #{ parseInt(color, 16) } ")
|
||||
color = color ^ bitFilter
|
||||
me.sphero.roll 60, Math.floor(Math.random() * 360)
|
||||
console.log("color: #{ color.toString(16) } ")
|
||||
me.sphero.setRGB(color)
|
||||
|
||||
every 1.second, ->
|
||||
me.sphero.roll 90, Math.floor(Math.random() * 360)
|
||||
|
|
|
@ -20,6 +20,11 @@ Cylon.robot
|
|||
Logger.info 'message:'
|
||||
Logger.info data
|
||||
|
||||
me.sphero.on 'collision', (data) ->
|
||||
me.sphero.setRGB(0xFF0000)
|
||||
Logger.info 'collision:'
|
||||
Logger.info data
|
||||
|
||||
me.sphero.on 'notification', (data) ->
|
||||
me.sphero.setRGB(0xFF0000)
|
||||
Logger.info 'notification:'
|
||||
|
|
Loading…
Reference in New Issue