5 axialMotor(
int enAPin,
int motorInitialState,
int pinCWOutputValue,
int pinCCWOutputValue,
int ProxSensor1Value,
int ProxSensor2Value);
32 axialMotor::axialMotor(
int enAPinValue,
int motorInitialState,
int pinCWOutputValue,
int pinCCWOutputValue,
int ProxSensor1Value,
int ProxSensor2Value)
71 else if (proximitySensor1Reading ==
false &&
getMotorState() ==
false)
83 if (proximitySensor2Reading ==
false &&
getMotorState() ==
true)
131 if (stateValue != -1 && stateValue != 1 && stateValue != 0)
184 if (sensorNumber == 1)
189 else if (sensorNumber == 2)
201 if (sensorNumber == 1)
206 else if (sensorNumber == 2)
218 if (directionNumber == 1)
222 else if (directionNumber == 2)
235 if (driveValue ==
true)
237 digitalWrite(
enAPin,HIGH);
239 else if (driveValue==
false)
251 return digitalRead(
enAPin);
void setEnableDrive(bool driveValue)
int getMotorState()
gets the motor current state.
void setMotorState(int stateValue)
Sets the motor state value to a given value of 0,1 or -1. If the value is not in this range...
int getProximitySensorPin(bool sensorNumber)
Gives the proximity sensor pin number on the arduino.
int getProximitySensorValue(bool sensorNumber)
Gives a sensor value. All proximity sensors are pulled up.
bool shouldSlowDown()
Checks if the requirement to make the motor stop are met. /return bool : value confirming if the moto...
axialMotor()
Construct the axial motor with no initial states/pinout. Motor state is then set to STOP (-1)...
bool runAxialCalibration()
Calibrate the assembly's vertical axis using the upper proximity sensor.
int getMotorPin(int directionNumber)
Gives the chosen motor direction pin.