Skip to content

Commit

Permalink
Update Step_er.h
Browse files Browse the repository at this point in the history
  • Loading branch information
DavideRuzza authored Aug 20, 2017
1 parent cbbeee3 commit 6fe295c
Showing 1 changed file with 45 additions and 45 deletions.
90 changes: 45 additions & 45 deletions Step_er.h
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
#ifndef Step_er
#define Step_er

#include "arduino.h"

#define WAVE_DRIVE 0
#define FULL_STEP 1
#define HALF_STEP 2

class Step_er {
public:

Step_er(int mode);
void attach(int IN1, int IN2, int IN3, int IN4);
void release();
void resetTo(int btn, boolean dir=true);
void step_move(int steps, boolean dir=true);
void ang_move(float ang, boolean dir=true);
void turn(int turns, boolean dir=true);
void one(boolean dir=true);

private:

void SetDirection();
void Stepping(int xw);

float ang_to_step(float ang);

int _IN1, _IN2, _IN3, _IN4;
int _mode;
int _Smax;
int _curStep = 0;
int _step, _stepLeft;
int _vel;
int _turns;
int _modes[3][8][4] = {
{{LOW, LOW, LOW, HIGH},{LOW, LOW, HIGH,LOW},{LOW, HIGH, LOW, LOW},{HIGH, LOW, LOW, LOW},{LOW, LOW, LOW, HIGH},{LOW, LOW, HIGH,LOW},{LOW, HIGH, LOW, LOW},{HIGH, LOW, LOW, LOW}},
{{LOW, LOW, HIGH, HIGH},{LOW, HIGH, HIGH, LOW},{HIGH, HIGH, LOW, LOW},{HIGH, LOW, LOW, HIGH},{LOW, LOW, HIGH, HIGH},{LOW, HIGH, HIGH, LOW},{HIGH, HIGH, LOW, LOW},{HIGH, LOW, LOW, HIGH}},
{{LOW, LOW, LOW, HIGH},{LOW, LOW, HIGH, HIGH},{LOW, LOW, HIGH, LOW},{LOW, HIGH, HIGH, LOW},{LOW, HIGH, LOW, LOW},{HIGH, HIGH, LOW, LOW},{HIGH, LOW, LOW, LOW},{HIGH, LOW, LOW, HIGH}}
};
boolean _dir;
unsigned long _ltime = 0;
unsigned long _curMils;
};

#ifndef St
#define St

#include "arduino.h"

#define WAVE_DRIVE 0
#define FULL_STEP 1
#define HALF_STEP 2

class Step_er {
public:

Step_er(int mode);
void attach(int IN1, int IN2, int IN3, int IN4);
void release();
void resetTo(int btn, boolean dir=true);
void step_move(int steps, boolean dir=true);
void ang_move(float ang, boolean dir=true);
void turn(int turns, boolean dir=true);
void one(boolean dir=true);

private:

void SetDirection();
void Stepping(int xw);

float ang_to_step(float ang);

int _IN1, _IN2, _IN3, _IN4;
int _mode;
int _Smax;
int _curStep = 0;
int _step, _stepLeft;
int _vel;
int _turns;
int _modes[3][8][4] = {
{{LOW, LOW, LOW, HIGH},{LOW, LOW, HIGH,LOW},{LOW, HIGH, LOW, LOW},{HIGH, LOW, LOW, LOW},{LOW, LOW, LOW, HIGH},{LOW, LOW, HIGH,LOW},{LOW, HIGH, LOW, LOW},{HIGH, LOW, LOW, LOW}},
{{LOW, LOW, HIGH, HIGH},{LOW, HIGH, HIGH, LOW},{HIGH, HIGH, LOW, LOW},{HIGH, LOW, LOW, HIGH},{LOW, LOW, HIGH, HIGH},{LOW, HIGH, HIGH, LOW},{HIGH, HIGH, LOW, LOW},{HIGH, LOW, LOW, HIGH}},
{{LOW, LOW, LOW, HIGH},{LOW, LOW, HIGH, HIGH},{LOW, LOW, HIGH, LOW},{LOW, HIGH, HIGH, LOW},{LOW, HIGH, LOW, LOW},{HIGH, HIGH, LOW, LOW},{HIGH, LOW, LOW, LOW},{HIGH, LOW, LOW, HIGH}}
};
boolean _dir;
unsigned long _ltime = 0;
unsigned long _curMils;
};

#endif

0 comments on commit 6fe295c

Please sign in to comment.