diff --git a/ino/mcopy_projector_firmware/McopyProjector.cpp b/ino/mcopy_projector_firmware/McopyProjector.cpp index 126c64a..2c83932 100644 --- a/ino/mcopy_projector_firmware/McopyProjector.cpp +++ b/ino/mcopy_projector_firmware/McopyProjector.cpp @@ -21,6 +21,11 @@ void McopyProjector::begin () { _feed.setSpeed(_speed); _feed.setAcceleration(1000.0); + pinMode(_takeupSettingA, OUTPUT); + pinMode(_takeupSettingB, OUTPUT); + pinMode(_feedSettingA, OUTPUT); + pinMode(_feedSettingB, OUTPUT); + setStepperMode(1); } diff --git a/ino/mcopy_projector_firmware/McopyProjector.h b/ino/mcopy_projector_firmware/McopyProjector.h index bb3fa7f..6238459 100644 --- a/ino/mcopy_projector_firmware/McopyProjector.h +++ b/ino/mcopy_projector_firmware/McopyProjector.h @@ -4,6 +4,23 @@ #include #include +/** + * 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 { private: diff --git a/ino/mcopy_projector_firmware/mcopy_projector_firmware.ino b/ino/mcopy_projector_firmware/mcopy_projector_firmware.ino index 49506dd..5530157 100644 --- a/ino/mcopy_projector_firmware/mcopy_projector_firmware.ino +++ b/ino/mcopy_projector_firmware/mcopy_projector_firmware.ino @@ -31,6 +31,12 @@ #define FEED_DIR_PIN 7 #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 feed(AccelStepper::DRIVER, FEED_STEP_PIN, FEED_DIR_PIN); @@ -50,7 +56,7 @@ volatile bool direction = true; volatile long start; McopySerial mcopy; -McopyProjector projector(takeup, feed); +McopyProjector projector(takeup, feed, TAKEUP_SETTINGS_A, TAKEUP_SETTINGS_B, FEED_SETTINGS_A, FEED_SETTINGS_B); void setup () { pins();