Permalink
Browse files

[minor] add new example to show use of multiple components

  • Loading branch information...
ecto committed Dec 8, 2011
1 parent d5bb9a9 commit d0bf4997c2f1460a985b1a4587e47efa06f7a2d8
Showing with 21 additions and 0 deletions.
  1. +21 −0 examples/combination.js
View
@@ -0,0 +1,21 @@
+var arduino = require('../');
+
+var board = new arduino.Board();
+
+var button = new arduino.Button({
+ board: board,
+ pin: 2
+});
+
+var led = new arduino.Led({
+ board: board,
+ pin: 13
+});
+
+button.on('down', function(){
+ led.on();
+});
+
+button.on('up', function(){
+ led.off();
+});

0 comments on commit d0bf499

Please sign in to comment.