-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
397 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
<!--remove-start--> | ||
|
||
# Keypad - MPR121 | ||
|
||
<!--remove-end--> | ||
|
||
|
||
|
||
|
||
|
||
|
||
##### Breadboard for "Keypad - MPR121" | ||
|
||
|
||
|
||
![docs/breadboard/keypad-MPR121.png](breadboard/keypad-MPR121.png)<br> | ||
|
||
| ||
|
||
|
||
|
||
|
||
Run with: | ||
```bash | ||
node eg/keypad-MPR121.js | ||
``` | ||
|
||
|
||
```javascript | ||
var exec = require("child_process").exec; | ||
var argv = require("minimist")(process.argv.slice(2), { default: { show: 1 } }); | ||
var five = require("../"); | ||
var board = new five.Board(); | ||
|
||
board.on("ready", function() { | ||
// MPR121 3x4 Capacitive Touch Pad | ||
var keypad; | ||
|
||
if (argv.show === 1) { | ||
keypad = new five.Keypad({ | ||
controller: "MPR121" | ||
}); | ||
} | ||
|
||
if (argv.show === 2) { | ||
keypad = new five.Keypad({ | ||
controller: "MPR121", | ||
keys: [ | ||
["!", "@", "#"], | ||
["$", "%", "^"], | ||
["&", "-", "+"], | ||
["_", "=", ":"] | ||
] | ||
}); | ||
} | ||
|
||
if (argv.show === 3) { | ||
keypad = new five.Keypad({ | ||
controller: "MPR121", | ||
keys: ["!", "@", "#", "$", "%", "^", "&", "-", "+", "_", "=", ":"] | ||
}); | ||
} | ||
|
||
["change", "press", "hold", "release"].forEach(function(eventType) { | ||
keypad.on(eventType, function(data) { | ||
console.log("Event: %s, Target: %s", eventType, data.which); | ||
}); | ||
}); | ||
}); | ||
|
||
``` | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
| ||
|
||
<!--remove-start--> | ||
|
||
## License | ||
Copyright (c) 2012, 2013, 2014 Rick Waldron <[email protected]> | ||
Licensed under the MIT license. | ||
Copyright (c) 2014, 2015 The Johnny-Five Contributors | ||
Licensed under the MIT license. | ||
|
||
<!--remove-end--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
<!--remove-start--> | ||
|
||
# Keypad - MPR121QR2 | ||
|
||
<!--remove-end--> | ||
|
||
|
||
|
||
|
||
|
||
|
||
##### Breadboard for "Keypad - MPR121QR2" | ||
|
||
|
||
|
||
![docs/breadboard/keypad-MPR121QR2.png](breadboard/keypad-MPR121QR2.png)<br> | ||
|
||
Fritzing diagram: [docs/breadboard/keypad-MPR121QR2.fzz](breadboard/keypad-MPR121QR2.fzz) | ||
|
||
| ||
|
||
|
||
|
||
|
||
Run with: | ||
```bash | ||
node eg/keypad-MPR121QR2.js | ||
``` | ||
|
||
|
||
```javascript | ||
var exec = require("child_process").exec; | ||
var argv = require("minimist")(process.argv.slice(2), { default: { show: 1 } }); | ||
var five = require("../"); | ||
var board = new five.Board(); | ||
|
||
board.on("ready", function() { | ||
// MPR121QR2 3x3 Capacitive Touch Shield | ||
var keypad; | ||
|
||
if (argv.show === 1) { | ||
keypad = new five.Keypad({ | ||
controller: "MPR121QR2" | ||
}); | ||
} | ||
|
||
if (argv.show === 2) { | ||
keypad = new five.Keypad({ | ||
controller: "MPR121QR2", | ||
keys: [ | ||
["!", "@", "#"], | ||
["$", "%", "^"], | ||
["&", "-", "+"], | ||
] | ||
}); | ||
} | ||
|
||
if (argv.show === 3) { | ||
keypad = new five.Keypad({ | ||
controller: "MPR121QR2", | ||
keys: ["!", "@", "#", "$", "%", "^", "&", "-", "+"] | ||
}); | ||
} | ||
|
||
["change", "press", "hold", "release"].forEach(function(eventType) { | ||
keypad.on(eventType, function(data) { | ||
console.log("Event: %s, Target: %s", eventType, data.which); | ||
}); | ||
}); | ||
}); | ||
|
||
``` | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
| ||
|
||
<!--remove-start--> | ||
|
||
## License | ||
Copyright (c) 2012, 2013, 2014 Rick Waldron <[email protected]> | ||
Licensed under the MIT license. | ||
Copyright (c) 2014, 2015 The Johnny-Five Contributors | ||
Licensed under the MIT license. | ||
|
||
<!--remove-end--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
<!--remove-start--> | ||
|
||
# Keypad - Waveshare AD | ||
|
||
<!--remove-end--> | ||
|
||
|
||
|
||
|
||
|
||
|
||
##### Breadboard for "Keypad - Waveshare AD" | ||
|
||
|
||
|
||
![docs/breadboard/keypad-analog-ad.png](breadboard/keypad-analog-ad.png)<br> | ||
|
||
| ||
|
||
|
||
|
||
|
||
Run with: | ||
```bash | ||
node eg/keypad-analog-ad.js | ||
``` | ||
|
||
|
||
```javascript | ||
var exec = require("child_process").exec; | ||
var argv = require("minimist")(process.argv.slice(2), { default: { show: 1 } }); | ||
var five = require("../"); | ||
var board = new five.Board(); | ||
|
||
board.on("ready", function() { | ||
// WaveShare AD Keypad | ||
var keypad; | ||
|
||
if (argv.show === 1) { | ||
keypad = new five.Keypad({ | ||
pin: "A0", | ||
length: 16 | ||
}); | ||
} | ||
|
||
if (argv.show === 2) { | ||
keypad = new five.Keypad({ | ||
pin: "A0", | ||
keys: [ | ||
["1", "!", "@", "#"], | ||
["2", "$", "%", "^"], | ||
["3", "&", "-", "+"], | ||
["4", "<", ">", "?"], | ||
] | ||
}); | ||
} | ||
|
||
if (argv.show === 3) { | ||
keypad = new five.Keypad({ | ||
pin: "A0", | ||
keys: ["1", "!", "@", "#", "2", "$", "%", "^", "3", "&", "-", "+", "4", "<", ">", "?"] | ||
}); | ||
} | ||
|
||
["change", "press", "hold", "release"].forEach(function(eventType) { | ||
keypad.on(eventType, function(data) { | ||
console.log("Event: %s, Target: %s", eventType, data.which); | ||
}); | ||
}); | ||
}); | ||
|
||
|
||
|
||
``` | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
| ||
|
||
<!--remove-start--> | ||
|
||
## License | ||
Copyright (c) 2012, 2013, 2014 Rick Waldron <[email protected]> | ||
Licensed under the MIT license. | ||
Copyright (c) 2014, 2015 The Johnny-Five Contributors | ||
Licensed under the MIT license. | ||
|
||
<!--remove-end--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
<!--remove-start--> | ||
|
||
# Keypad - VKEY | ||
|
||
<!--remove-end--> | ||
|
||
|
||
|
||
|
||
|
||
|
||
##### Breadboard for "Keypad - VKEY" | ||
|
||
|
||
|
||
![docs/breadboard/keypad-analog-vkey.png](breadboard/keypad-analog-vkey.png)<br> | ||
|
||
| ||
|
||
|
||
|
||
|
||
Run with: | ||
```bash | ||
node eg/keypad-analog-vkey.js | ||
``` | ||
|
||
|
||
```javascript | ||
var exec = require("child_process").exec; | ||
var argv = require("minimist")(process.argv.slice(2), { default: { show: 1 } }); | ||
var five = require("../"); | ||
var board = new five.Board(); | ||
|
||
board.on("ready", function() { | ||
// Sparkfun's VKey Voltage Keypad | ||
var keypad; | ||
|
||
if (argv.show === 1) { | ||
keypad = new five.Keypad({ | ||
controller: "VKEY", | ||
pin: "A0", | ||
}); | ||
} | ||
|
||
if (argv.show === 2) { | ||
keypad = new five.Keypad({ | ||
controller: "VKEY", | ||
pin: "A0", | ||
keys: [ | ||
["!", "@", "#"], | ||
["$", "%", "^"], | ||
["&", "-", "+"], | ||
["<", ">", "?"], | ||
] | ||
}); | ||
} | ||
|
||
if (argv.show === 3) { | ||
keypad = new five.Keypad({ | ||
controller: "VKEY", | ||
pin: "A0", | ||
keys: ["!", "@", "#", "$", "%", "^", "&", "-", "+", "<", ">", "?"] | ||
}); | ||
} | ||
|
||
["change", "press", "hold", "release"].forEach(function(eventType) { | ||
keypad.on(eventType, function(data) { | ||
console.log("Event: %s, Target: %s", eventType, data.which); | ||
}); | ||
}); | ||
}); | ||
|
||
|
||
|
||
``` | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
| ||
|
||
<!--remove-start--> | ||
|
||
## License | ||
Copyright (c) 2012, 2013, 2014 Rick Waldron <[email protected]> | ||
Licensed under the MIT license. | ||
Copyright (c) 2014, 2015 The Johnny-Five Contributors | ||
Licensed under the MIT license. | ||
|
||
<!--remove-end--> |
Oops, something went wrong.