diff --git a/ino/lib/EndstopCameraShield/EndstopCameraShield.cpp b/ino/lib/EndstopCameraShield/EndstopCameraShield.cpp index a2b16fa..098e6e0 100644 --- a/ino/lib/EndstopCameraShield/EndstopCameraShield.cpp +++ b/ino/lib/EndstopCameraShield/EndstopCameraShield.cpp @@ -112,7 +112,6 @@ uint32_t EndstopCameraShield::frame() { while (running) { if (!primed && i > _minSteps) { _enableCloseEmitter(); - _enableOpenEmitter(); //_enableCloseInterrupt(); primed = true; } @@ -124,8 +123,8 @@ uint32_t EndstopCameraShield::frame() { _motor.step(); i++; } - //_disableCloseInterrupt(); _disableCloseEmitter(); + //_disableCloseInterrupt(); return i; } @@ -138,7 +137,6 @@ uint32_t EndstopCameraShield::toOpen() { while (running) { if (!primed && i > _minSteps) { _enableOpenEmitter(); - _enableCloseEmitter(); //_enableOpenInterrupt(); primed = true; } @@ -150,8 +148,8 @@ uint32_t EndstopCameraShield::toOpen() { _motor.step(); i++; } - //_disableOpenInterrupt(); _disableOpenEmitter(); + //_disableOpenInterrupt(); return i; } @@ -164,7 +162,6 @@ uint32_t EndstopCameraShield::toClose() { while (running) { if (!primed && i > _minSteps) { _enableCloseEmitter(); - _enableOpenEmitter(); //_enableCloseInterrupt(); primed = true; } @@ -176,8 +173,8 @@ uint32_t EndstopCameraShield::toClose() { _motor.step(); i++; } - _disableCloseInterrupt(); - //_disableCloseEmitter(); + _disableCloseEmitter(); + //_disableCloseInterrupt(); return i; } @@ -188,6 +185,10 @@ void EndstopCameraShield::setDirection(bool direction) { } } +bool EndstopCameraShield::getDirection() { + return _direction; +} + bool EndstopCameraShield::isOpened() { return _isOpened; } diff --git a/ino/lib/EndstopCameraShield/EndstopCameraShield.h b/ino/lib/EndstopCameraShield/EndstopCameraShield.h index 9377f1a..68e0725 100644 --- a/ino/lib/EndstopCameraShield/EndstopCameraShield.h +++ b/ino/lib/EndstopCameraShield/EndstopCameraShield.h @@ -65,6 +65,7 @@ class EndstopCameraShield { uint32_t toOpen(); uint32_t toClose(); void setDirection(bool direction); + bool getDirection(); bool isOpened(); bool isClosed(); void test(); diff --git a/ino/mcopy_mitchell_camera/EndstopCameraShield.cpp b/ino/mcopy_mitchell_camera/EndstopCameraShield.cpp index a2b16fa..098e6e0 100644 --- a/ino/mcopy_mitchell_camera/EndstopCameraShield.cpp +++ b/ino/mcopy_mitchell_camera/EndstopCameraShield.cpp @@ -112,7 +112,6 @@ uint32_t EndstopCameraShield::frame() { while (running) { if (!primed && i > _minSteps) { _enableCloseEmitter(); - _enableOpenEmitter(); //_enableCloseInterrupt(); primed = true; } @@ -124,8 +123,8 @@ uint32_t EndstopCameraShield::frame() { _motor.step(); i++; } - //_disableCloseInterrupt(); _disableCloseEmitter(); + //_disableCloseInterrupt(); return i; } @@ -138,7 +137,6 @@ uint32_t EndstopCameraShield::toOpen() { while (running) { if (!primed && i > _minSteps) { _enableOpenEmitter(); - _enableCloseEmitter(); //_enableOpenInterrupt(); primed = true; } @@ -150,8 +148,8 @@ uint32_t EndstopCameraShield::toOpen() { _motor.step(); i++; } - //_disableOpenInterrupt(); _disableOpenEmitter(); + //_disableOpenInterrupt(); return i; } @@ -164,7 +162,6 @@ uint32_t EndstopCameraShield::toClose() { while (running) { if (!primed && i > _minSteps) { _enableCloseEmitter(); - _enableOpenEmitter(); //_enableCloseInterrupt(); primed = true; } @@ -176,8 +173,8 @@ uint32_t EndstopCameraShield::toClose() { _motor.step(); i++; } - _disableCloseInterrupt(); - //_disableCloseEmitter(); + _disableCloseEmitter(); + //_disableCloseInterrupt(); return i; } @@ -188,6 +185,10 @@ void EndstopCameraShield::setDirection(bool direction) { } } +bool EndstopCameraShield::getDirection() { + return _direction; +} + bool EndstopCameraShield::isOpened() { return _isOpened; } diff --git a/ino/mcopy_mitchell_camera/EndstopCameraShield.h b/ino/mcopy_mitchell_camera/EndstopCameraShield.h index 9377f1a..68e0725 100644 --- a/ino/mcopy_mitchell_camera/EndstopCameraShield.h +++ b/ino/mcopy_mitchell_camera/EndstopCameraShield.h @@ -65,6 +65,7 @@ class EndstopCameraShield { uint32_t toOpen(); uint32_t toClose(); void setDirection(bool direction); + bool getDirection(); bool isOpened(); bool isClosed(); void test(); diff --git a/ino/mcopy_oxberry_camera/EndstopCameraShield.cpp b/ino/mcopy_oxberry_camera/EndstopCameraShield.cpp index a2b16fa..098e6e0 100644 --- a/ino/mcopy_oxberry_camera/EndstopCameraShield.cpp +++ b/ino/mcopy_oxberry_camera/EndstopCameraShield.cpp @@ -112,7 +112,6 @@ uint32_t EndstopCameraShield::frame() { while (running) { if (!primed && i > _minSteps) { _enableCloseEmitter(); - _enableOpenEmitter(); //_enableCloseInterrupt(); primed = true; } @@ -124,8 +123,8 @@ uint32_t EndstopCameraShield::frame() { _motor.step(); i++; } - //_disableCloseInterrupt(); _disableCloseEmitter(); + //_disableCloseInterrupt(); return i; } @@ -138,7 +137,6 @@ uint32_t EndstopCameraShield::toOpen() { while (running) { if (!primed && i > _minSteps) { _enableOpenEmitter(); - _enableCloseEmitter(); //_enableOpenInterrupt(); primed = true; } @@ -150,8 +148,8 @@ uint32_t EndstopCameraShield::toOpen() { _motor.step(); i++; } - //_disableOpenInterrupt(); _disableOpenEmitter(); + //_disableOpenInterrupt(); return i; } @@ -164,7 +162,6 @@ uint32_t EndstopCameraShield::toClose() { while (running) { if (!primed && i > _minSteps) { _enableCloseEmitter(); - _enableOpenEmitter(); //_enableCloseInterrupt(); primed = true; } @@ -176,8 +173,8 @@ uint32_t EndstopCameraShield::toClose() { _motor.step(); i++; } - _disableCloseInterrupt(); - //_disableCloseEmitter(); + _disableCloseEmitter(); + //_disableCloseInterrupt(); return i; } @@ -188,6 +185,10 @@ void EndstopCameraShield::setDirection(bool direction) { } } +bool EndstopCameraShield::getDirection() { + return _direction; +} + bool EndstopCameraShield::isOpened() { return _isOpened; } diff --git a/ino/mcopy_oxberry_camera/EndstopCameraShield.h b/ino/mcopy_oxberry_camera/EndstopCameraShield.h index 9377f1a..68e0725 100644 --- a/ino/mcopy_oxberry_camera/EndstopCameraShield.h +++ b/ino/mcopy_oxberry_camera/EndstopCameraShield.h @@ -65,6 +65,7 @@ class EndstopCameraShield { uint32_t toOpen(); uint32_t toClose(); void setDirection(bool direction); + bool getDirection(); bool isOpened(); bool isClosed(); void test();