diff --git a/app/data/cfg.json b/app/data/cfg.json index b4a3495..66ef943 100644 --- a/app/data/cfg.json +++ b/app/data/cfg.json @@ -1,5 +1,5 @@ { - "version": "1.8.91", + "version": "1.8.92", "ext_port": 1111, "profiles": { "mcopy": { diff --git a/app/package-lock.json b/app/package-lock.json index 0540842..57bbc50 100644 --- a/app/package-lock.json +++ b/app/package-lock.json @@ -1,6 +1,6 @@ { "name": "mcopy-app", - "version": "1.8.91", + "version": "1.8.92", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/app/package.json b/app/package.json index c51bb4d..c40236c 100644 --- a/app/package.json +++ b/app/package.json @@ -1,6 +1,6 @@ { "name": "mcopy-app", - "version": "1.8.91", + "version": "1.8.92", "description": "GUI for the mcopy small gauge film optical printer platform", "main": "main.js", "scripts": { diff --git a/data/cfg.json b/data/cfg.json index b4a3495..66ef943 100644 --- a/data/cfg.json +++ b/data/cfg.json @@ -1,5 +1,5 @@ { - "version": "1.8.91", + "version": "1.8.92", "ext_port": 1111, "profiles": { "mcopy": { diff --git a/ino/mcopy_JKMM100/mcopy_JKMM100.ino b/ino/mcopy_JKMM100/mcopy_JKMM100.ino index de91bf1..d1e869f 100644 --- a/ino/mcopy_JKMM100/mcopy_JKMM100.ino +++ b/ino/mcopy_JKMM100/mcopy_JKMM100.ino @@ -51,6 +51,7 @@ const int PROJECTOR_FRAME = 600; const int PROJECTOR_MICROSWITCH_CLOSED = 0; const int PROJECTOR_MICROSWITCH_OPENED = 1; const int PROJECTOR_HALF_TIME = 450; +const int PROJECTOR_STOP_DELAY = 3; //PROJECTOR VARIABLES boolean proj_dir = true; @@ -126,17 +127,34 @@ void proj_start () { void proj_stop () { //stop both directions - delay(10); + delay(2); digitalWrite(PROJECTOR_FWD, LOW); digitalWrite(PROJECTOR_BWD, LOW); digitalWrite(LED_FWD, LOW); digitalWrite(LED_BWD, LOW); + if (digitalRead(PROJECTOR_MICROSWITCH) == PROJECTOR_MICROSWITCH_CLOSED) { + if (proj_dir) { + while (digitalRead(PROJECTOR_MICROSWITCH) == PROJECTOR_MICROSWITCH_CLOSED) { + digitalWrite(PROJECTOR_BWD, HIGH); + delay(PROJECTOR_STOP_DELAY); + } + digitalWrite(PROJECTOR_BWD, LOW); + } else { + while (digitalRead(PROJECTOR_MICROSWITCH) == PROJECTOR_MICROSWITCH_CLOSED) { + digitalWrite(PROJECTOR_FWD, HIGH); + delay(PROJECTOR_STOP_DELAY); + } + digitalWrite(PROJECTOR_FWD, LOW); + } + } mc.confirm(mc.PROJECTOR); mc.log("projector()"); proj_running = false; + delay(16); update_timing(millis() - proj_time); + } void proj_direction (boolean state) { @@ -171,7 +189,7 @@ void proj_microswitch () { proj_micro_state = val; //unneeded? proj_stop(); } else { - //delay(2); //some smothing value + delay(2); //some smothing value } } diff --git a/ino/mcopy_JKMM100_work/mcopy_JKMM100_work.ino b/ino/mcopy_JKMM100_work/mcopy_JKMM100_work.ino index 6457ab2..aa58fc9 100644 --- a/ino/mcopy_JKMM100_work/mcopy_JKMM100_work.ino +++ b/ino/mcopy_JKMM100_work/mcopy_JKMM100_work.ino @@ -51,7 +51,7 @@ const int PROJECTOR_FRAME = 600; const int PROJECTOR_MICROSWITCH_CLOSED = 0; const int PROJECTOR_MICROSWITCH_OPENED = 1; const int PROJECTOR_HALF_TIME = 450; -const int PROJECTOR_STOP_DELAY = 1; +const int PROJECTOR_STOP_DELAY = 3; //PROJECTOR VARIABLES boolean proj_dir = true; @@ -127,7 +127,7 @@ void proj_start () { void proj_stop () { //stop both directions - //delay(10); + delay(2); digitalWrite(PROJECTOR_FWD, LOW); digitalWrite(PROJECTOR_BWD, LOW); digitalWrite(LED_FWD, LOW); @@ -194,7 +194,7 @@ void proj_microswitch () { proj_micro_state = val; //unneeded? proj_stop(); } else { - //delay(1); //some smothing value + delay(2); //some smothing value } } diff --git a/package-lock.json b/package-lock.json index 56246f7..992f3e6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "mcopy", - "version": "1.8.91", + "version": "1.8.92", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "mcopy", - "version": "1.8.91", + "version": "1.8.92", "license": "MIT", "dependencies": { "arduino": "file:app/lib/arduino", diff --git a/package.json b/package.json index df3f6a8..24db508 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mcopy", - "version": "1.8.91", + "version": "1.8.92", "description": "Small gauge film optical printer platform", "main": "build.js", "directories": { diff --git a/processing/mcopy/cfg.json b/processing/mcopy/cfg.json index b4a3495..66ef943 100644 --- a/processing/mcopy/cfg.json +++ b/processing/mcopy/cfg.json @@ -1,5 +1,5 @@ { - "version": "1.8.91", + "version": "1.8.92", "ext_port": 1111, "profiles": { "mcopy": {