From 966f67882a55d4e515ea520c715f4abb76228531 Mon Sep 17 00:00:00 2001 From: mattmcw Date: Sun, 30 Jun 2024 11:50:02 -0400 Subject: [PATCH] Fix ino.sh script. Add pin declarations to EndstopCameraShield --- .../EndstopCameraShield/EndstopCameraShield.cpp | 15 +++++++++++++++ ino/lib/EndstopCameraShield/EndstopCameraShield.h | 10 ++++++++++ ino/mcopy_mitchell_camera/EndstopCameraShield.cpp | 15 +++++++++++++++ ino/mcopy_mitchell_camera/EndstopCameraShield.h | 10 ++++++++++ ino/mcopy_oxberry_camera/EndstopCameraShield.cpp | 15 +++++++++++++++ ino/mcopy_oxberry_camera/EndstopCameraShield.h | 10 ++++++++++ ino/mcopy_oxberry_camera/mcopy_oxberry_camera.ino | 6 ++++-- notes/LED_brightness.txt | 9 +++++++++ scripts/ino.sh | 2 +- 9 files changed, 89 insertions(+), 3 deletions(-) create mode 100644 ino/lib/EndstopCameraShield/EndstopCameraShield.cpp create mode 100644 ino/mcopy_mitchell_camera/EndstopCameraShield.cpp create mode 100644 ino/mcopy_oxberry_camera/EndstopCameraShield.cpp create mode 100644 notes/LED_brightness.txt diff --git a/ino/lib/EndstopCameraShield/EndstopCameraShield.cpp b/ino/lib/EndstopCameraShield/EndstopCameraShield.cpp new file mode 100644 index 0000000..b9ea84c --- /dev/null +++ b/ino/lib/EndstopCameraShield/EndstopCameraShield.cpp @@ -0,0 +1,15 @@ +#include "EndstopCameraShield.h" + +EndstopCameraShield::EndstopCameraShield () : motor(motorEnablePin, motorDirectionPin, motorPulsePin, motorUsPulse, motorMicrosteps) { + +} + +void EndstopCameraShield::loop () { + +} + +void EndstopCameraShield::setup () { + motor.setup(); + pinMode(emitterOpenPin, OUTPUT); + pinMode(emitterClosePin, OUTPUT); +} \ No newline at end of file diff --git a/ino/lib/EndstopCameraShield/EndstopCameraShield.h b/ino/lib/EndstopCameraShield/EndstopCameraShield.h index 6531aa6..214a643 100644 --- a/ino/lib/EndstopCameraShield/EndstopCameraShield.h +++ b/ino/lib/EndstopCameraShield/EndstopCameraShield.h @@ -2,6 +2,7 @@ #define EndstopCameraShield_h #include +#include "TB6600MotorDriver.h" /** * Default pins @@ -18,6 +19,15 @@ class EndstopCameraShield { const uint8_t emitterOpenPin = 4; const uint8_t emitterClosePin = 5; + const uint8_t motorEnablePin = 6; + const uint8_t motorDirectionPin = 7; + const uint8_t motorPulsePin = 8; + + const uint32_t motorUsPulse = 300; + const uint8_t motorMicrosteps = 2; //half stepping + + TB6600MotorDriver motor; + public: EndstopCameraShield(); diff --git a/ino/mcopy_mitchell_camera/EndstopCameraShield.cpp b/ino/mcopy_mitchell_camera/EndstopCameraShield.cpp new file mode 100644 index 0000000..b9ea84c --- /dev/null +++ b/ino/mcopy_mitchell_camera/EndstopCameraShield.cpp @@ -0,0 +1,15 @@ +#include "EndstopCameraShield.h" + +EndstopCameraShield::EndstopCameraShield () : motor(motorEnablePin, motorDirectionPin, motorPulsePin, motorUsPulse, motorMicrosteps) { + +} + +void EndstopCameraShield::loop () { + +} + +void EndstopCameraShield::setup () { + motor.setup(); + pinMode(emitterOpenPin, OUTPUT); + pinMode(emitterClosePin, OUTPUT); +} \ No newline at end of file diff --git a/ino/mcopy_mitchell_camera/EndstopCameraShield.h b/ino/mcopy_mitchell_camera/EndstopCameraShield.h index 6531aa6..214a643 100644 --- a/ino/mcopy_mitchell_camera/EndstopCameraShield.h +++ b/ino/mcopy_mitchell_camera/EndstopCameraShield.h @@ -2,6 +2,7 @@ #define EndstopCameraShield_h #include +#include "TB6600MotorDriver.h" /** * Default pins @@ -18,6 +19,15 @@ class EndstopCameraShield { const uint8_t emitterOpenPin = 4; const uint8_t emitterClosePin = 5; + const uint8_t motorEnablePin = 6; + const uint8_t motorDirectionPin = 7; + const uint8_t motorPulsePin = 8; + + const uint32_t motorUsPulse = 300; + const uint8_t motorMicrosteps = 2; //half stepping + + TB6600MotorDriver motor; + public: EndstopCameraShield(); diff --git a/ino/mcopy_oxberry_camera/EndstopCameraShield.cpp b/ino/mcopy_oxberry_camera/EndstopCameraShield.cpp new file mode 100644 index 0000000..b9ea84c --- /dev/null +++ b/ino/mcopy_oxberry_camera/EndstopCameraShield.cpp @@ -0,0 +1,15 @@ +#include "EndstopCameraShield.h" + +EndstopCameraShield::EndstopCameraShield () : motor(motorEnablePin, motorDirectionPin, motorPulsePin, motorUsPulse, motorMicrosteps) { + +} + +void EndstopCameraShield::loop () { + +} + +void EndstopCameraShield::setup () { + motor.setup(); + pinMode(emitterOpenPin, OUTPUT); + pinMode(emitterClosePin, OUTPUT); +} \ No newline at end of file diff --git a/ino/mcopy_oxberry_camera/EndstopCameraShield.h b/ino/mcopy_oxberry_camera/EndstopCameraShield.h index 6531aa6..214a643 100644 --- a/ino/mcopy_oxberry_camera/EndstopCameraShield.h +++ b/ino/mcopy_oxberry_camera/EndstopCameraShield.h @@ -2,6 +2,7 @@ #define EndstopCameraShield_h #include +#include "TB6600MotorDriver.h" /** * Default pins @@ -18,6 +19,15 @@ class EndstopCameraShield { const uint8_t emitterOpenPin = 4; const uint8_t emitterClosePin = 5; + const uint8_t motorEnablePin = 6; + const uint8_t motorDirectionPin = 7; + const uint8_t motorPulsePin = 8; + + const uint32_t motorUsPulse = 300; + const uint8_t motorMicrosteps = 2; //half stepping + + TB6600MotorDriver motor; + public: EndstopCameraShield(); diff --git a/ino/mcopy_oxberry_camera/mcopy_oxberry_camera.ino b/ino/mcopy_oxberry_camera/mcopy_oxberry_camera.ino index 8f56ce2..1bb6bb7 100644 --- a/ino/mcopy_oxberry_camera/mcopy_oxberry_camera.ino +++ b/ino/mcopy_oxberry_camera/mcopy_oxberry_camera.ino @@ -1,10 +1,12 @@ #include "EndstopCameraShield.h" #include "McopySerial.h" +EndstopCameraShield cam(); + void setup () { - + cam.setup(); } void loop () { - + cam.loop(); } \ No newline at end of file diff --git a/notes/LED_brightness.txt b/notes/LED_brightness.txt new file mode 100644 index 0000000..dd1b7cf --- /dev/null +++ b/notes/LED_brightness.txt @@ -0,0 +1,9 @@ +15,000 mcd minimum brightness + + Pack of 25 clear white LEDs + 5mm diameter + Cool White color + 3.0V Typical Forward Voltage, at 20mA current + 15,000 mcd minimum brightness + Viewing Angle : ±12 degrees + Maximum continuous current: 20 mA \ No newline at end of file diff --git a/scripts/ino.sh b/scripts/ino.sh index c699b14..e6d698c 100644 --- a/scripts/ino.sh +++ b/scripts/ino.sh @@ -30,7 +30,7 @@ MCOPYSERIAL=( mcopy_mitchell_camera ) -ENSTOPCAMERASHIELD=( +ENDSTOPCAMERASHIELD=( mcopy_oxberry_camera mcopy_mitchell_camera )