cylon/examples/beaglebone_button/bbb_button.coffee

18 lines
324 B
CoffeeScript
Raw Normal View History

2014-01-21 05:34:16 +08:00
Cylon = require('../..')
# Initialize the robot
Cylon.robot
connection:
name: 'beaglebone', adaptor: 'beaglebone'
devices:
[
{name: 'led', driver: 'led', pin: 'P9_12'},
{name: 'button', driver: 'button', pin: 'P9_14'}
]
work: (my) ->
my.button.on 'push', () -> my.led.toggle()
.start()