Restore settings logic
This commit is contained in:
parent
03f2b55762
commit
eec7765e73
|
@ -21,6 +21,11 @@ void McopyProjector::begin () {
|
||||||
_feed.setSpeed(_speed);
|
_feed.setSpeed(_speed);
|
||||||
_feed.setAcceleration(1000.0);
|
_feed.setAcceleration(1000.0);
|
||||||
|
|
||||||
|
pinMode(_takeupSettingA, OUTPUT);
|
||||||
|
pinMode(_takeupSettingB, OUTPUT);
|
||||||
|
pinMode(_feedSettingA, OUTPUT);
|
||||||
|
pinMode(_feedSettingB, OUTPUT);
|
||||||
|
|
||||||
setStepperMode(1);
|
setStepperMode(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,23 @@
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include <AccelStepper.h>
|
#include <AccelStepper.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* D2 X Step
|
||||||
|
* D3 X Direction
|
||||||
|
* D4 X MS1 setting
|
||||||
|
* D5 X MS2 setting
|
||||||
|
* D6 Y Step
|
||||||
|
* D7 Y Direction
|
||||||
|
* D8 Y MS1 setting
|
||||||
|
* D9 Y MS2 setting
|
||||||
|
*
|
||||||
|
* MS1(X/Y) MS2(X/Y) Description
|
||||||
|
* L L Full step
|
||||||
|
* H L Half step
|
||||||
|
* L H Quarter step
|
||||||
|
* H H Eighth STEP
|
||||||
|
**/
|
||||||
|
|
||||||
class McopyProjector {
|
class McopyProjector {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -31,6 +31,12 @@
|
||||||
#define FEED_DIR_PIN 7
|
#define FEED_DIR_PIN 7
|
||||||
#define FEED_STEP_PIN 6
|
#define FEED_STEP_PIN 6
|
||||||
|
|
||||||
|
#define TAKEUP_SETTINGS_A 4
|
||||||
|
#define TAKEUP_SETTINGS_B 5
|
||||||
|
|
||||||
|
#define FEED_SETTINGS_A 8
|
||||||
|
#define FEED_SETTINGS_B 9
|
||||||
|
|
||||||
AccelStepper takeup(AccelStepper::DRIVER, TAKEUP_STEP_PIN, TAKEUP_DIR_PIN);
|
AccelStepper takeup(AccelStepper::DRIVER, TAKEUP_STEP_PIN, TAKEUP_DIR_PIN);
|
||||||
AccelStepper feed(AccelStepper::DRIVER, FEED_STEP_PIN, FEED_DIR_PIN);
|
AccelStepper feed(AccelStepper::DRIVER, FEED_STEP_PIN, FEED_DIR_PIN);
|
||||||
|
|
||||||
|
@ -50,7 +56,7 @@ volatile bool direction = true;
|
||||||
volatile long start;
|
volatile long start;
|
||||||
|
|
||||||
McopySerial mcopy;
|
McopySerial mcopy;
|
||||||
McopyProjector projector(takeup, feed);
|
McopyProjector projector(takeup, feed, TAKEUP_SETTINGS_A, TAKEUP_SETTINGS_B, FEED_SETTINGS_A, FEED_SETTINGS_B);
|
||||||
|
|
||||||
void setup () {
|
void setup () {
|
||||||
pins();
|
pins();
|
||||||
|
|
Loading…
Reference in New Issue