Merge pull request #12 from hybridgroup/12-upd-collision-example

Updated collision example to perform better and start running when you d...
This commit is contained in:
Ron Evans 2013-10-28 20:55:21 -07:00
commit 4268a25ad7
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()