cylon/examples/sphero.coffee

15 lines
266 B
CoffeeScript
Raw Normal View History

2013-10-24 10:58:51 +08:00
Cylon = require('..')
2013-10-24 04:27:23 +08:00
Cylon.robot
2013-10-24 04:27:23 +08:00
connection:
name: 'sphero', adaptor: 'sphero', port: '/dev/rfcomm0'
2013-10-24 04:27:23 +08:00
device:
name: 'sphero', driver: 'sphero'
work: (me) ->
2013-10-25 05:25:42 +08:00
every 1.second(), ->
2013-10-25 15:43:59 +08:00
me.sphero.roll 60, Math.floor(Math.random() * 360)
.start()