# Switch

```javascript
var five, board, swtchA, swtchB;

five = require("../lib/johnny-five.js");

board = new five.Board({
  debug: true
});

board.on("ready", function() {

  // Create a new `swtch` hardware instance.
  swtchA = five.Switch({
    // Switch pins are an array of pins
    // Pin orders:
    //   [ up, down, left, right ]
    //   [ up, down, left, right, center ]
    //   [ up, down ]
    // pins: [ 2, 3, 4, 5 ]
    pins: [ 2 ],
    a: "A"
  });

  swtchB = new five.Switch({
    b: "B"
  });


  console.log( swtchA );
  console.log( swtchB );

  // // Inject the `swtch` hardware into
  // // the Repl instance's context;
  // // allows direct command line access
  // board.repl.inject({
  //   swtch: swtch
  // });

  // // Switch Event API

  // swtch.on("change", function( err, timestamp ) {

  //   // console.log( this.direction );
  // });
});


// Schematic
// https://1965269182786388413-a-1802744773732722657-s-sites.googlegroups.com/site/parallaxinretailstores/home/2-axis-swtch/Switch-6.png
// http://www.parallax.com/Portals/0/Downloads/docs/prod/sens/27800-Axis%20JoyStick_B%20Schematic.pdf

// Further Reading
// http://www.parallax.com/Portals/0/Downloads/docs/prod/sens/27800-2-AxisSwitch-v1.2.pdf

```

## Breadboard




## Documentation

_(Nothing yet)_









## Contributing
All contributions must adhere to the the [Idiomatic.js Style Guide](https://github.com/rwldrn/idiomatic.js),
by maintaining the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [grunt](https://github.com/cowboy/grunt).

## Release History
_(Nothing yet)_

## License
Copyright (c) 2012 Rick Waldron <waldron.rick@gmail.com>
Licensed under the MIT license.
