-
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
12 changed files
with
84 additions
and
94 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
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
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 |
---|---|---|
@@ -1,22 +1,21 @@ | ||
var five = require("../lib/johnny-five.js"); | ||
var board = new five.Board(); | ||
const {Board, Led} = require("../lib/johnny-five.js"); | ||
const board = new Board(); | ||
|
||
board.on("ready", function() { | ||
|
||
var led = new five.Led(11); | ||
const led = new Led(11); | ||
|
||
led.fade({ | ||
easing: "linear", | ||
duration: 1000, | ||
cuePoints: [0, 0.2, 0.4, 0.6, 0.8, 1], | ||
keyFrames: [0, 250, 25, 150, 100, 125], | ||
onstop: function() { | ||
onstop: () => { | ||
console.log("Animation stopped"); | ||
} | ||
}); | ||
|
||
// Toggle the led after 2 seconds (shown in ms) | ||
this.wait(2000, function() { | ||
this.wait(2000, () => { | ||
led.fadeOut(); | ||
}); | ||
}); |
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 |
---|---|---|
@@ -1,14 +1,13 @@ | ||
var five = require("../lib/johnny-five.js"); | ||
var board = new five.Board(); | ||
const {Board, Led} = require("../lib/johnny-five.js"); | ||
const board = new Board(); | ||
|
||
board.on("ready", function() { | ||
|
||
var led = new five.Led(11); | ||
const led = new Led(11); | ||
|
||
led.fadeIn(); | ||
|
||
// Toggle the led after 5 seconds (shown in ms) | ||
this.wait(5000, function() { | ||
this.wait(5000, () => { | ||
led.fadeOut(); | ||
}); | ||
}); |
Oops, something went wrong.