2013-11-07 01:02:20 +08:00
|
|
|
Cylon = require('..')
|
|
|
|
|
|
|
|
# Initialize the robot
|
|
|
|
Cylon.robot
|
|
|
|
connection:
|
|
|
|
name: 'raspi', adaptor: 'raspi'
|
|
|
|
|
|
|
|
devices:
|
|
|
|
[
|
2013-11-07 03:44:37 +08:00
|
|
|
{name: 'led', driver: 'led', pin: 11},
|
|
|
|
{name: 'button', driver: 'button', pin: 7}
|
2013-11-07 01:02:20 +08:00
|
|
|
]
|
|
|
|
|
|
|
|
work: (my) ->
|
2013-11-07 04:19:14 +08:00
|
|
|
my.button.on 'push', () -> my.led.toggle()
|
2013-11-07 01:02:20 +08:00
|
|
|
|
|
|
|
.start()
|