Skip to content

Commit 202fbb7

Browse files
author
rohitmanokaran
committed
robot fix
1 parent f55c1ee commit 202fbb7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

robot.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Robot.prototype.setLeft = function (value) {
2222
}
2323
};
2424

25-
Robot.prototype.setRight - function (value) {
25+
Robot.prototype.setRight = function (value) {
2626
if (value == 0) {
2727
this.board.analogWrite(PWM_R, 0);
2828
} else {
@@ -32,14 +32,14 @@ Robot.prototype.setRight - function (value) {
3232
};
3333

3434
Robot.prototype.bindSocket = function (socket) {
35-
socket.on('robot', function (data) {
35+
socket.on('robot', (function (data) {
3636
if ('left' in data) {
3737
this.setLeft(data.left);
3838
}
3939
if ('right' in data) {
4040
this.setRight(data.right);
4141
}
42-
});
42+
}).bind(this));
4343
};
4444

4545
exports.create = function (descriptor) {

0 commit comments

Comments
 (0)