Skip to content

Commit

Permalink
Remove bogus null arguments from emitters. Fixes gh-561
Browse files Browse the repository at this point in the history
  • Loading branch information
rwaldron committed Apr 30, 2015
1 parent 310cdd1 commit 2b4cf6f
Show file tree
Hide file tree
Showing 69 changed files with 285 additions and 307 deletions.
2 changes: 1 addition & 1 deletion docs/accelerometer-pan-tilt.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ board.on("ready", function() {
// Center all servos
(five.Servos()).center();

accel.on("acceleration", function(err, timestamp) {
accel.on("acceleration", function() {
// console.log( "acceleration", this.axis );

tilt.to(Math.abs(Math.ceil(170 * this.pitch.toFixed(2)) - 180));
Expand Down
6 changes: 3 additions & 3 deletions docs/classic-controller.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ board.on("ready", function() {
// Fired when the joystick detects a change in
// axis position.
//
nunchuk.joystick.left.on("change", function(err, event) {
nunchuk.joystick.left.on("change", function(event) {
console.log(
"Left joystick " + event.axis,
event.target[event.axis],
event.axis, event.direction
);
});

nunchuk.joystick.right.on("change", function(err, event) {
nunchuk.joystick.right.on("change", function(event) {
console.log(
"Right joystick " + event.axis,
event.target[event.axis],
Expand Down Expand Up @@ -92,7 +92,7 @@ board.on("ready", function() {

["down", "up", "hold"].forEach(function(type) {

nunchuk.on(type, function(err, event) {
nunchuk.on(type, function(event) {
console.log(
event.target.which + " is " + type,

Expand Down
6 changes: 3 additions & 3 deletions docs/ir-motion.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ board.on("ready", function() {

// "calibrated" occurs once, at the beginning of a session,
motion.on("calibrated", function() {
console.log("calibrated");
console.log("calibrated", Date.now());
});

// "motionstart" events are fired when the "calibrated"
// proximal area is disrupted, generally by some form of movement
motion.on("motionstart", function() {
console.log("motionstart");
console.log("motionstart", Date.now());
});

// "motionend" events are fired following a "motionstart" event
// when no movement has occurred in X ms
motion.on("motionend", function() {
console.log("motionend");
console.log("motionend", Date.now());
});
});

Expand Down
4 changes: 2 additions & 2 deletions docs/ir-reflect-array.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ five.Board().on("ready", function() {

// calibrate for two seconds
eyes.calibrateUntil(function() { return !calibrating; });
setTimeout(function() { calibrating = false; }, 2000);
setTimeout(function() { calibrating = false; }, 2000);

eyes.enable();

// "line"
//
// Fires continuously once calibrated
//
eyes.on("line", function(err, line) {
eyes.on("line", function(line) {
console.log("line: ", line);
});
});
Expand Down
2 changes: 1 addition & 1 deletion docs/ir-reflect.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ five.Board().on("ready", function() {
//
// Fires continuously, every 66ms.
//
ir.on("data", function(err, timestamp) {
ir.on("data", function() {
console.log("data");
});
});
Expand Down
2 changes: 1 addition & 1 deletion docs/joystick-motor-led.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ board.on("ready", function() {

// Pushing the joystick to up position should start the motor,
// releasing it will turn the motor off.
joystick.on("axismove", function(err, timestamp) {
joystick.on("axismove", function() {

if (!motor.isOn && this.axis.y > 0.51) {
motor.start();
Expand Down
2 changes: 1 addition & 1 deletion docs/joystick.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ board.on("ready", function() {
});

// Joystick Event API
joystick.on("axismove", function(err, timestamp) {
joystick.on("axismove", function() {

// Axis data is available on:
// this.axis
Expand Down
24 changes: 12 additions & 12 deletions docs/motor-3-pin.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ board.on("ready", function() {
pwm: 9
dir: 8
cdir: 11
Motor B
pwm: 10
dir: 12
Expand All @@ -34,7 +34,7 @@ board.on("ready", function() {
pwm: 6
dir: 5
cdir: 7
Motor B
pwm: 4
dir: 3
Expand All @@ -58,29 +58,29 @@ board.on("ready", function() {
motor: motor
});

motor.on("start", function(err, timestamp) {
console.log("start", timestamp);
motor.on("start", function() {
console.log("start", Date.now());
});

motor.on("stop", function(err, timestamp) {
console.log("automated stop on timer", timestamp);
motor.on("stop", function() {
console.log("automated stop on timer", Date.now());
});

motor.on("brake", function(err, timestamp) {
console.log("automated brake on timer", timestamp);
motor.on("brake", function() {
console.log("automated brake on timer", Date.now());
});

motor.on("forward", function(err, timestamp) {
console.log("forward", timestamp);
motor.on("forward", function() {
console.log("forward", Date.now());

// demonstrate switching to reverse after 5 seconds
board.wait(5000, function() {
motor.reverse(255);
});
});

motor.on("reverse", function(err, timestamp) {
console.log("reverse", timestamp);
motor.on("reverse", function() {
console.log("reverse", Date.now());

// demonstrate braking after 5 seconds
board.wait(5000, function() {
Expand Down
8 changes: 4 additions & 4 deletions docs/motor-PCA9685.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ board.on("ready", function() {
// Motor Event API

// "start" events fire when the motor is started.
motor.on("start", function(err, timestamp) {
console.log("start", timestamp);
motor.on("start", function() {
console.log("start", Date.now());

// Demonstrate motor stop in 2 seconds
board.wait(2000, function() {
Expand All @@ -50,8 +50,8 @@ board.on("ready", function() {
});

// "stop" events fire when the motor is started.
motor.on("stop", function(err, timestamp) {
console.log("stop", timestamp);
motor.on("stop", function() {
console.log("stop", Date.now());
});

// Motor API
Expand Down
20 changes: 10 additions & 10 deletions docs/motor-brake.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,29 +43,29 @@ board.on("ready", function() {
motor: motor
});

motor.on("start", function(err, timestamp) {
console.log("start", timestamp);
motor.on("start", function() {
console.log("start", Date.now());
});

motor.on("stop", function(err, timestamp) {
console.log("automated stop on timer", timestamp);
motor.on("stop", function() {
console.log("automated stop on timer", Date.now());
});

motor.on("brake", function(err, timestamp) {
console.log("automated brake on timer", timestamp);
motor.on("brake", function() {
console.log("automated brake on timer", Date.now());
});

motor.on("forward", function(err, timestamp) {
console.log("forward", timestamp);
motor.on("forward", function() {
console.log("forward", Date.now());

// demonstrate switching to reverse after 5 seconds
board.wait(5000, function() {
motor.reverse(150);
});
});

motor.on("reverse", function(err, timestamp) {
console.log("reverse", timestamp);
motor.on("reverse", function() {
console.log("reverse", Date.now());

// demonstrate stopping after 5 seconds
board.wait(5000, function() {
Expand Down
20 changes: 10 additions & 10 deletions docs/motor-current.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,29 +56,29 @@ board.on("ready", function() {
console.log("Motor A: " + this.value.toFixed(2) + "mA");
});

motor.on("start", function(err, timestamp) {
console.log("start", timestamp);
motor.on("start", function() {
console.log("start", Date.now());
});

motor.on("stop", function(err, timestamp) {
console.log("automated stop on timer", timestamp);
motor.on("stop", function() {
console.log("automated stop on timer", Date.now());
});

motor.on("brake", function(err, timestamp) {
console.log("automated brake on timer", timestamp);
motor.on("brake", function() {
console.log("automated brake on timer", Date.now());
});

motor.on("forward", function(err, timestamp) {
console.log("forward", timestamp);
motor.on("forward", function() {
console.log("forward", Date.now());

// demonstrate switching to reverse after 5 seconds
board.wait(5000, function() {
motor.reverse(150);
});
});

motor.on("reverse", function(err, timestamp) {
console.log("reverse", timestamp);
motor.on("reverse", function() {
console.log("reverse", Date.now());

// demonstrate stopping after 5 seconds
board.wait(5000, function() {
Expand Down
16 changes: 8 additions & 8 deletions docs/motor-directional.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,25 +74,25 @@ board.on("ready", function() {
motor: motor
});

motor.on("start", function(err, timestamp) {
console.log("start", timestamp);
motor.on("start", function() {
console.log("start", Date.now());
});

motor.on("stop", function(err, timestamp) {
console.log("automated stop on timer", timestamp);
motor.on("stop", function() {
console.log("automated stop on timer", Date.now());
});

motor.on("forward", function(err, timestamp) {
console.log("forward", timestamp);
motor.on("forward", function() {
console.log("forward", Date.now());

// demonstrate switching to reverse after 5 seconds
board.wait(5000, function() {
motor.reverse(50);
});
});

motor.on("reverse", function(err, timestamp) {
console.log("reverse", timestamp);
motor.on("reverse", function() {
console.log("reverse", Date.now());

// demonstrate stopping after 5 seconds
board.wait(5000, function() {
Expand Down
16 changes: 8 additions & 8 deletions docs/motor-hbridge.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,25 +47,25 @@ board.on("ready", function() {
motor: motor
});

motor.on("start", function(err, timestamp) {
console.log("start", timestamp);
motor.on("start", function() {
console.log("start", Date.now());
});

motor.on("stop", function(err, timestamp) {
console.log("automated stop on timer", timestamp);
motor.on("stop", function() {
console.log("automated stop on timer", Date.now());
});

motor.on("forward", function(err, timestamp) {
console.log("forward", timestamp);
motor.on("forward", function() {
console.log("forward", Date.now());

// demonstrate switching to reverse after 5 seconds
board.wait(5000, function() {
motor.reverse(50);
});
});

motor.on("reverse", function(err, timestamp) {
console.log("reverse", timestamp);
motor.on("reverse", function() {
console.log("reverse", Date.now());

// demonstrate stopping after 5 seconds
board.wait(5000, function() {
Expand Down
8 changes: 4 additions & 4 deletions docs/motor.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ board.on("ready", function() {
// Motor Event API

// "start" events fire when the motor is started.
motor.on("start", function(err, timestamp) {
console.log("start", timestamp);
motor.on("start", function() {
console.log("start", Date.now());

// Demonstrate motor stop in 2 seconds
board.wait(2000, function() {
Expand All @@ -43,8 +43,8 @@ board.on("ready", function() {
});

// "stop" events fire when the motor is started.
motor.on("stop", function(err, timestamp) {
console.log("stop", timestamp);
motor.on("stop", function() {
console.log("stop", Date.now());
});

// Motor API
Expand Down
6 changes: 3 additions & 3 deletions docs/nunchuk.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ board.on("ready", function() {
// Fired when the joystick detects a change in
// axis position.
//
nunchuk.joystick.on("change", function(err, event) {
nunchuk.joystick.on("change", function(event) {
console.log(
"joystick " + event.axis,
event.target[event.axis],
Expand All @@ -62,7 +62,7 @@ board.on("ready", function() {
// Fired when the accelerometer detects a change in
// axis position.
//
nunchuk.accelerometer.on("change", function(err, event) {
nunchuk.accelerometer.on("change", function(event) {
console.log(
"accelerometer " + event.axis,
event.target[event.axis],
Expand Down Expand Up @@ -94,7 +94,7 @@ board.on("ready", function() {

["down", "up", "hold"].forEach(function(type) {

nunchuk.on(type, function(err, event) {
nunchuk.on(type, function(event) {
console.log(
event.target.which + " is " + type,

Expand Down
1 change: 0 additions & 1 deletion docs/ping.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ board.on("ready", function() {
// Calculated distance to object in centimeters
//


ping.on("change", function() {
console.log("Object is " + this.in + " inches away");
});
Expand Down
2 changes: 1 addition & 1 deletion docs/sonar-scan.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ board.on("ready", function() {
// [2] Sonar "change" events are emitted when the value of a
// distance reading has changed since the previous reading
//
sonar.on("change", function(err) {
sonar.on("change", function() {
var turnTo;

// Detect collision
Expand Down
Loading

0 comments on commit 2b4cf6f

Please sign in to comment.