Added collision event to the messages example and updated collision example.

This commit is contained in:
Edgar O Silva 2013-10-28 19:59:44 -06:00
parent 507e381ae6
commit 517a093604
2 changed files with 7 additions and 3 deletions

View File

@ -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)

View File

@ -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:'