Skip to content

Commit

Permalink
Update examples, add deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
derekwheee committed May 10, 2015
1 parent dcaac93 commit 63e1b85
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/motion-gp2y0d805z0f.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ board.on("ready", function() {
// "data" events are fired at the interval set in opts.freq
// or every 25ms
motion.on("data", function(data) {
//console.log(data);
console.log(data);
});
});

Expand Down
1 change: 1 addition & 0 deletions lib/ir.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Devices = {
*
*/

/* @deprecated */
"GP2Y0D805Z0F": {
type: "proximity",
address: 0x26,
Expand Down
8 changes: 6 additions & 2 deletions lib/johnny-five.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,18 @@ module.exports.Sensor.Analog = module.exports.Analog;
module.exports.Sensor.Digital = module.exports.Digital;

/**
* @deprecated Will be deleted in version 0.9.0. Use Proximity instead.
* @deprecated Will be deleted in version 1.0.0. Use Proximity instead.
*/
module.exports.IR.Distance = function(opts) {
console.log("IR.Distance is deprecated. Use Proximity instead");
return new module.exports.Distance(opts);
};

/**
* @deprecated Will be deleted in version 1.0.0. Use Motion instead.
*/
module.exports.IR.Motion = function(opt) {
console.log("IR.Motion is deprecated. Use Motion instead");
return new module.exports.Pir(
typeof opt === "number" ? opt : (
opt.pin === undefined ? 7 : opt.pin
Expand All @@ -85,7 +89,7 @@ module.exports.IR.Motion = function(opt) {
};

/**
* @deprecated Will be deleted in version 0.9.0. Use Proximity instead.
* @deprecated Will be deleted in version 1.0.0. Use Proximity instead.
*/
module.exports.IR.Proximity = function(opts) {
console.log("IR.Proximity is deprecated. Use Proximity instead");
Expand Down
1 change: 1 addition & 0 deletions lib/pir.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ var Board = require("../lib/board.js"),

/**
* Pir, IR.Motion
* @deprecated
* @param {Object} opts Options: pin, type, id, range
*/

Expand Down

0 comments on commit 63e1b85

Please sign in to comment.