Updated collision example to perform better and start running when you drop the sphero.

This commit is contained in:
Edgar O Silva 2013-10-28 21:05:11 -06:00
parent 83f5e6c4c3
commit c7afd83336
1 changed files with 1 additions and 2 deletions

View File

@ -15,6 +15,7 @@ Cylon.robot
Logger.info('Setting up Collision Detection...')
me.sphero.detectCollisions()
me.sphero.setRGB(color)
me.sphero.stop()
)
me.sphero.on 'collision', (data) ->
@ -22,8 +23,6 @@ Cylon.robot
color = color ^ bitFilter
console.log("color: #{ color.toString(16) } ")
me.sphero.setRGB(color)
every 1.second, ->
me.sphero.roll 90, Math.floor(Math.random() * 360)
.start()