-
Notifications
You must be signed in to change notification settings - Fork 44
/
SwitecX12.h
30 lines (27 loc) · 1.01 KB
/
SwitecX12.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef SwitecX12_h
#define SwitecX12_h
#include <Arduino.h>
class SwitecX12 {
public:
unsigned char pinStep;
unsigned char pinDir;
unsigned int currentStep; // step we are currently at
unsigned int targetStep; // target we are moving to
unsigned int steps; // total steps available
unsigned long time0; // time when we entered this state
unsigned int microDelay; // microsecs until next state
unsigned short (*accelTable)[2]; // accel table can be modified.
unsigned int maxVel; // fastest vel allowed
unsigned int vel; // steps travelled under acceleration
int dir; // direction -1,0,1
boolean stopped; // true if stopped
SwitecX12(unsigned int steps, unsigned char pinStep, unsigned char pinDir);
//void stepUp();
void step(int dir);
void zero();
void stepTo(int position);
void advance();
void update();
void setPosition(unsigned int pos);
};
#endif