Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Keypad: complete upgrade to multi-touch
- Loading branch information
Showing
32 changed files
with
909 additions
and
274 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
Binary file not shown.
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.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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
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--> | ||
|
||
# Touchpad - MPR121QR2_SHIELD | ||
|
||
<!--remove-end--> | ||
|
||
|
||
|
||
|
||
|
||
|
||
##### Breadboard for "Touchpad - MPR121QR2_SHIELD" | ||
|
||
|
||
|
||
![docs/breadboard/keypad-MPR121QR2_SHIELD.png](breadboard/keypad-MPR121QR2_SHIELD.png)<br> | ||
|
||
Fritzing diagram: [docs/breadboard/keypad-MPR121QR2_SHIELD.fzz](breadboard/keypad-MPR121QR2_SHIELD.fzz) | ||
|
||
| ||
|
||
|
||
|
||
|
||
Run this example from the command line with: | ||
```bash | ||
node eg/keypad-MPR121QR2_SHIELD.js | ||
``` | ||
|
||
|
||
```javascript | ||
var argv = require("minimist")(process.argv.slice(2), { default: { show: 1 } }); | ||
var five = require("johnny-five"); | ||
var board = new five.Board(); | ||
|
||
board.on("ready", function() { | ||
// MPR121QR2 3x3 Capacitive Touch Shield | ||
var touchpad; | ||
|
||
if (argv.show === 1) { | ||
touchpad = new five.Touchpad({ | ||
controller: "MPR121QR2_SHIELD" | ||
}); | ||
} | ||
|
||
if (argv.show === 2) { | ||
touchpad = new five.Touchpad({ | ||
controller: "MPR121QR2_SHIELD", | ||
keys: [ | ||
["!", "@", "#"], | ||
["$", "%", "^"], | ||
["&", "-", "+"], | ||
] | ||
}); | ||
} | ||
|
||
if (argv.show === 3) { | ||
touchpad = new five.Touchpad({ | ||
controller: "MPR121QR2_SHIELD", | ||
keys: ["!", "@", "#", "$", "%", "^", "&", "-", "+"] | ||
}); | ||
} | ||
|
||
["change", "press", "hold", "release"].forEach(function(eventType) { | ||
touchpad.on(eventType, function(event) { | ||
console.log("Event: %s, Target: %s", eventType, event.which); | ||
}); | ||
}); | ||
}); | ||
|
||
``` | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
| ||
|
||
<!--remove-start--> | ||
|
||
## License | ||
Copyright (c) 2012, 2013, 2014 Rick Waldron <waldron.rick@gmail.com> | ||
Licensed under the MIT license. | ||
Copyright (c) 2016 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,88 @@ | ||
<!--remove-start--> | ||
|
||
# Touchpad - MPR121_KEYPAD | ||
|
||
<!--remove-end--> | ||
|
||
|
||
|
||
|
||
|
||
|
||
##### Breadboard for "Touchpad - MPR121_KEYPAD" | ||
|
||
|
||
|
||
![docs/breadboard/keypad-MPR121_KEYPAD.png](breadboard/keypad-MPR121_KEYPAD.png)<br> | ||
|
||
| ||
|
||
|
||
|
||
|
||
Run this example from the command line with: | ||
```bash | ||
node eg/keypad-MPR121_KEYPAD.js | ||
``` | ||
|
||
|
||
```javascript | ||
var argv = require("minimist")(process.argv.slice(2), { default: { show: 1 } }); | ||
var five = require("johnny-five"); | ||
var board = new five.Board(); | ||
|
||
board.on("ready", function() { | ||
var touchpad; | ||
|
||
if (argv.show === 1) { | ||
touchpad = new five.Touchpad({ | ||
controller: "MPR121_KEYPAD" | ||
}); | ||
} | ||
|
||
if (argv.show === 2) { | ||
touchpad = new five.Touchpad({ | ||
controller: "MPR121_KEYPAD", | ||
keys: [ | ||
["!", "@", "#"], | ||
["$", "%", "^"], | ||
["&", "-", "+"], | ||
["_", "=", ":"] | ||
] | ||
}); | ||
} | ||
|
||
if (argv.show === 3) { | ||
touchpad = new five.Touchpad({ | ||
controller: "MPR121_KEYPAD", | ||
keys: ["!", "@", "#", "$", "%", "^", "&", "-", "+", "_", "=", ":"] | ||
}); | ||
} | ||
|
||
["change", "press", "hold", "release"].forEach(function(eventType) { | ||
touchpad.on(eventType, function(event) { | ||
console.log("Event: %s, Target: %s", eventType, event.which); | ||
}); | ||
}); | ||
}); | ||
|
||
``` | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
| ||
|
||
<!--remove-start--> | ||
|
||
## License | ||
Copyright (c) 2012, 2013, 2014 Rick Waldron <waldron.rick@gmail.com> | ||
Licensed under the MIT license. | ||
Copyright (c) 2016 The Johnny-Five Contributors | ||
Licensed under the MIT license. | ||
|
||
<!--remove-end--> |
Oops, something went wrong.