cylon/examples/beaglebone_button/bbb_button.coffee

18 lines
324 B
CoffeeScript

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()