Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/weisjohn/nes-controller
Interface to a Gtron Nintendo Entertainment System USB controller or Tomee NES to USB adapter.
https://github.com/weisjohn/nes-controller
Last synced: about 1 month ago
JSON representation
Interface to a Gtron Nintendo Entertainment System USB controller or Tomee NES to USB adapter.
- Host: GitHub
- URL: https://github.com/weisjohn/nes-controller
- Owner: weisjohn
- License: mit
- Created: 2014-05-31T05:07:07.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-01-26T01:15:50.000Z (almost 9 years ago)
- Last Synced: 2024-11-17T04:05:41.377Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 9.77 KB
- Stars: 3
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
nes-controller
==============Interface to a
[Gtron USB Nintendo Entertainment System controller](http://www.amazon.com/gp/product/B002YVD3KM) or [Tomee NES to USB adapter](http://www.amazon.com/gp/product/B00HM3QCN2).
Forked from [@dustMason](https://github.com/dustMason)'s [n64controller](https://github.com/dustMason/n64controller) module.`npm install nes-controller`
### usage
```
var controllers = require('nes-controller')();
var player1 = controllers[0];player1.on('pressA', function() {
console.log('A was pressed');
});player1.on('releaseA', function() {
console.log('A was released');
});
```See the [example.js](example.js) file for more detailed usage.
### API
- `pressA`
- `releaseA`
- `pressB`
- `releaseB`
- `pressSTART`
- `releaseSTART`
- `pressSELECT`
- `releaseSELECT`
- `analog`
- `analogNS`
- `analogEW``analogNS` and `analogEW` receive one value, while `analog` receives an array of two values.
The directional values are either `0`, `127`, `255`.
### others
If you have an NES USB Controller that isn't supported, pull requests are welcome.