cylon/examples/raspi_button.coffee

18 lines
300 B
CoffeeScript
Raw Normal View History

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