2013-10-24 10:58:51 +08:00
|
|
|
Cylon = require('..')
|
2013-10-24 04:27:23 +08:00
|
|
|
|
2013-10-25 03:46:43 +08:00
|
|
|
Cylon.robot
|
2013-10-24 04:27:23 +08:00
|
|
|
connection:
|
2013-10-24 14:18:19 +08:00
|
|
|
name: 'sphero', adaptor: 'sphero', port: '/dev/rfcomm0'
|
2013-10-24 04:27:23 +08:00
|
|
|
|
2013-10-24 14:18:19 +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)
|
2013-10-25 03:46:43 +08:00
|
|
|
|
|
|
|
.start()
|