Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nkolban committed May 27, 2016
1 parent d0ff681 commit fe440db
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stepper-wiringpi",
"version": "0.0.1",
"version": "0.0.2",
"description": "Module to control a stepper motor",
"main": "src/stepper-wiringpi.js",
"scripts": {
Expand All @@ -19,6 +19,8 @@
"type": "git",
"url": "https://github.com/nkolban/node-stepper-wiringpi.git"
},
"os" : ["linux"],
"cpu" : ["arm"],
"author": "Neil Kolban",
"license": "MIT",
"readmeFilename": "README.md"
Expand Down
14 changes: 7 additions & 7 deletions src/stepper-wiringpi.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,10 +399,10 @@ function stepMotor()
}
else if (this._pinCount == 4) {
switch (thisStep % 4) {
case 0: // 1010
case 0: // 1100
wpi.digitalWrite(this._motorPin1, wpi.HIGH);
wpi.digitalWrite(this._motorPin2, wpi.LOW);
wpi.digitalWrite(this._motorPin3, wpi.HIGH);
wpi.digitalWrite(this._motorPin2, wpi.HIGH);
wpi.digitalWrite(this._motorPin3, wpi.LOW);
wpi.digitalWrite(this._motorPin4, wpi.LOW);
break;
case 1: // 0110
Expand All @@ -411,13 +411,13 @@ function stepMotor()
wpi.digitalWrite(this._motorPin3, wpi.HIGH);
wpi.digitalWrite(this._motorPin4, wpi.LOW);
break;
case 2: //0101
case 2: // 0011
wpi.digitalWrite(this._motorPin1, wpi.LOW);
wpi.digitalWrite(this._motorPin2, wpi.HIGH);
wpi.digitalWrite(this._motorPin3, wpi.LOW);
wpi.digitalWrite(this._motorPin2, wpi.LOW);
wpi.digitalWrite(this._motorPin3, wpi.HIGH);
wpi.digitalWrite(this._motorPin4, wpi.HIGH);
break;
case 3: //1001
case 3: // 1001
wpi.digitalWrite(this._motorPin1, wpi.HIGH);
wpi.digitalWrite(this._motorPin2, wpi.LOW);
wpi.digitalWrite(this._motorPin3, wpi.LOW);
Expand Down

0 comments on commit fe440db

Please sign in to comment.