Skip to content
This repository was archived by the owner on Dec 20, 2018. It is now read-only.

Commit 54ea9e4

Browse files
author
Andrew Nesbitt
committed
Within function documentation
1 parent fd91767 commit 54ea9e4

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

Readme.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Interface for Xbox 360 game controller into Node.js
44

5-
Lots of low level details about the controller here:
5+
Lots of low level details about the controller here:
66
* http://free60.org/GamePad
77
* http://tattiebogle.net/index.php/ProjectRoot/Xbox360Controller/UsbInfo
88
* http://euc.jp/periphs/xbox-controller.ja.html
@@ -37,7 +37,7 @@ Mac OSX driver: http://tattiebogle.net/index.php/ProjectRoot/Xbox360Controller/O
3737
xbox.on('right:move', function(position){
3838
console.log('right:move', position);
3939
});
40-
40+
4141
## LEDs
4242

4343
Set LED pattern on controller:
@@ -72,12 +72,22 @@ Control left and right rumble motors:
7272

7373
Where the strengths are between 0 and 255.
7474

75+
## Within function
76+
77+
Listen for when a trigger or stick's position is within a particular range:
78+
79+
```javascript
80+
xbox.within('righttrigger', [50,100], function(err, data){
81+
console.log('rightttrigger within 50 and 100', err, data);
82+
});
83+
```
84+
7585
## Third Party Controllers
7686

7787
If you have a third party controller with a different name you can specify the name when creating the controller:
7888

7989
var xbox = new XboxController('flight stick');
80-
90+
8191
## Configuring a Third Party Controller
8292

8393
To configure a third party controller:

0 commit comments

Comments
 (0)