Almost the button example
This commit is contained in:
parent
16a049f586
commit
8372486a00
|
@ -0,0 +1,18 @@
|
|||
Cylon = require('..')
|
||||
|
||||
# Initialize the robot
|
||||
Cylon.robot
|
||||
connection:
|
||||
name: 'arduino', adaptor: 'firmata', port: '/dev/ttyACM0'
|
||||
|
||||
devices:
|
||||
[
|
||||
{name: 'led', driver: 'led', pin: 13},
|
||||
{name: 'button', driver: 'button', pin: 2}
|
||||
]
|
||||
|
||||
work: (my) ->
|
||||
# we do our thing here
|
||||
my.button.on 'pushed', -> my.led.toggle()
|
||||
#my.button.on 'released', -> Logger.info 'ho'
|
||||
.start()
|
Loading…
Reference in New Issue