-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* rewrite for 4.4 kernel * upgrade to linux-io v0.5.7 * update tests * add node.js v0.12, v4 and v6 to travis * use g++ 4.8 on travis * add node.js v5 and v7 to travis * use ecap folder rather than pwm folder for pwm on p9_42 * redundant code removed * redundant code removed * readme updated and migration guide added
- Loading branch information
1 parent
a090837
commit 33d8170
Showing
23 changed files
with
963 additions
and
1,265 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,18 @@ | ||
language: node_js | ||
node_js: | ||
- "0.10" | ||
- "0.12" | ||
- "4" | ||
- "5" | ||
- "6" | ||
- "7" | ||
before_script: | ||
- npm install -g grunt-cli | ||
compiler: clang | ||
env: | ||
- CXX=g++-4.8 | ||
addons: | ||
apt: | ||
sources: | ||
- ubuntu-toolchain-r-test | ||
packages: | ||
- g++-4.8 |
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,17 @@ | ||
'use strict'; | ||
|
||
var five = require('johnny-five'); | ||
var BeagleBone = require('..'); | ||
|
||
var board = new five.Board({ | ||
io: new BeagleBone() | ||
}); | ||
|
||
board.on('ready', function() { | ||
var led2 = new five.Led('USR2'), | ||
led3 = new five.Led('USR3'); | ||
|
||
led2.blink(500); | ||
led3.blink(500); | ||
}); | ||
|
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,21 @@ | ||
'use strict'; | ||
|
||
var five = require('johnny-five'); | ||
var BeagleBone = require('..'); | ||
|
||
var board = new five.Board({ | ||
io: new BeagleBone() | ||
}); | ||
|
||
board.on('ready', function() { | ||
var button = new five.Button('GPIO47'); | ||
|
||
button.on('down', function() { | ||
console.log('down'); | ||
}); | ||
|
||
button.on('up', function() { | ||
console.log('up'); | ||
}); | ||
}); | ||
|
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,29 @@ | ||
'use strict'; | ||
|
||
var five = require('johnny-five'); | ||
var BeagleBone = require('..'); | ||
|
||
var board = new five.Board({ | ||
io: new BeagleBone() | ||
}); | ||
|
||
board.on('ready', function() { | ||
var pin = board.io.normalize('GPIO46'), | ||
writesPerSecond, | ||
time, | ||
i; | ||
|
||
this.pinMode(pin, five.Pin.OUTPUT); | ||
|
||
time = process.hrtime(); | ||
|
||
for (i = 1; i <= 250000; i += 1) { | ||
this.digitalWrite(pin, i & 1); | ||
} | ||
|
||
time = process.hrtime(time); | ||
writesPerSecond = Math.floor(i / (time[0] + time[1] / 1E9)); | ||
|
||
console.log(writesPerSecond + ' digitalWrite calls per second'); | ||
}); | ||
|
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,28 @@ | ||
'use strict'; | ||
|
||
var five = require('johnny-five'); | ||
var BeagleBone = require('..'); | ||
|
||
var board = new five.Board({ | ||
io: new BeagleBone() | ||
}); | ||
|
||
board.on('ready', function() { | ||
var accelerometer = new five.Accelerometer({ | ||
controller: "ADXL345" | ||
}); | ||
|
||
accelerometer.on("change", function() { | ||
console.log("accelerometer"); | ||
console.log(" x : ", this.x); | ||
console.log(" y : ", this.y); | ||
console.log(" z : ", this.z); | ||
console.log(" pitch : ", this.pitch); | ||
console.log(" roll : ", this.roll); | ||
console.log(" acceleration : ", this.acceleration); | ||
console.log(" inclination : ", this.inclination); | ||
console.log(" orientation : ", this.orientation); | ||
console.log("--------------------------------------"); | ||
}); | ||
}); | ||
|
Oops, something went wrong.