2024-06-23 02:57:20 +00:00
|
|
|
#ifndef EndstopCameraShield_h
|
|
|
|
#define EndstopCameraShield_h
|
|
|
|
|
|
|
|
#include <Arduino.h>
|
2024-06-30 15:50:02 +00:00
|
|
|
#include "TB6600MotorDriver.h"
|
2024-06-23 02:57:20 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Default pins
|
|
|
|
* 2 Close Receiver Pin
|
|
|
|
* 3 Open Receiver Pin
|
|
|
|
* 4 Open Emitter Pin
|
|
|
|
* 5 Close Emitter Pin
|
|
|
|
**/
|
|
|
|
|
|
|
|
class EndstopCameraShield {
|
|
|
|
private:
|
2024-06-24 01:38:36 +00:00
|
|
|
const uint8_t receiverClosePin = 2;
|
|
|
|
const uint8_t receiverOpenPin = 3;
|
|
|
|
const uint8_t emitterOpenPin = 4;
|
|
|
|
const uint8_t emitterClosePin = 5;
|
2024-06-23 02:57:20 +00:00
|
|
|
|
2024-06-30 15:50:02 +00:00
|
|
|
const uint8_t motorEnablePin = 6;
|
|
|
|
const uint8_t motorDirectionPin = 7;
|
|
|
|
const uint8_t motorPulsePin = 8;
|
|
|
|
|
2024-06-30 16:10:30 +00:00
|
|
|
volatile uint32_t motorUsPulse = 300;
|
|
|
|
volatile uint8_t motorMicrosteps = 2; //half stepping
|
2024-06-30 15:50:02 +00:00
|
|
|
|
|
|
|
TB6600MotorDriver motor;
|
|
|
|
|
2024-06-23 02:57:20 +00:00
|
|
|
public:
|
|
|
|
|
2024-06-30 16:10:30 +00:00
|
|
|
EndstopCameraShield(uint32_t usPulse, uint8_t microsteps);
|
2024-06-23 02:57:20 +00:00
|
|
|
|
|
|
|
void setup();
|
|
|
|
void loop();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|