Skip to content

Commit

Permalink
final
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Apr 9, 2016
1 parent 956556e commit 9d4bfba
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,24 +194,24 @@ board.on("ready", function() {
socket.on('turnLeft', function(){
console.log("Server: Turning left! ");
// Turn on right motor
that.digitalWrite(rMotorN1, 1);
that.digitalWrite(rMotorN2, 0);
that.digitalWrite(rMotorN1, 0);
that.digitalWrite(rMotorN2, 1);
that.analogWrite(rMotorNA, speed);
// Turn on left motor
that.digitalWrite(lMotorN3, 1);
that.digitalWrite(lMotorN4, 0);
that.digitalWrite(lMotorN3, 0);
that.digitalWrite(lMotorN4, 1);
that.analogWrite(lMotorNB, speed);
});

socket.on('turnRight', function(){
console.log("Server: Turning right! ");
// Turn on right motor
that.digitalWrite(rMotorN1, 0);
that.digitalWrite(rMotorN2, 1);
that.digitalWrite(rMotorN1, 1);
that.digitalWrite(rMotorN2, 0);
that.analogWrite(rMotorNA, speed);
// Turn on left motor
that.digitalWrite(lMotorN3, 0);
that.digitalWrite(lMotorN4, 1);
that.digitalWrite(lMotorN3, 1);
that.digitalWrite(lMotorN4, 0);
that.analogWrite(lMotorNB, speed);
});

Expand Down

0 comments on commit 9d4bfba

Please sign in to comment.