Revamped Delay timeing
Added Backlash Compensation
This commit is contained in:
parent
cc1bdaa82f
commit
303f32ad6d
2 changed files with 67 additions and 60 deletions
15
plotter.h
15
plotter.h
|
|
@ -18,17 +18,17 @@ private:
|
|||
Pwm16b _pwm;
|
||||
Point currentPos = {0, 0};
|
||||
|
||||
uint16_t prevDiamondAngle = 60000;
|
||||
uint16_t prevSteps = 10;
|
||||
uint16_t _prevDiamondAngle = 60000;
|
||||
uint16_t _prevSteps = 10;
|
||||
|
||||
volatile unsigned char *_penPort;
|
||||
char _penPin;
|
||||
|
||||
|
||||
|
||||
|
||||
Serial* _serial;
|
||||
|
||||
uint16_t diamondAngle(int16_t y, int16_t x);
|
||||
static uint16_t diamondAngle(int16_t y, int16_t x);
|
||||
static uint16_t calculateDelayTime(uint16_t currentDiamondAngle, uint16_t prevDiamondAngle, uint16_t prevSteps);
|
||||
|
||||
|
||||
public:
|
||||
Plotter(volatile unsigned char *penPort, const char penPin, Serial* serial);
|
||||
|
|
@ -38,7 +38,8 @@ public:
|
|||
void pu();
|
||||
void moveto(Point *pt);
|
||||
void moveto(uint16_t nx,uint16_t ny);
|
||||
|
||||
void moveRelative(int32_t deltaX, int32_t deltaY);
|
||||
void moveRelative(Point *pt);
|
||||
Point getCurrentPos();
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue