#include <axialMotor.h>
|
| | axialMotor (int enAPin, int motorInitialState, int pinCWOutputValue, int pinCCWOutputValue, int ProxSensor1Value, int ProxSensor2Value) |
| | Construct the axial motor with initial states/pinout. More...
|
| |
| | axialMotor () |
| | Construct the axial motor with no initial states/pinout. Motor state is then set to STOP (-1), and proximity sensor pinout to 51 and 53 by default. More...
|
| |
| bool | shouldSlowDown () |
| | Checks if the requirement to make the motor stop are met. /return bool : value confirming if the motor should slow down or not. More...
|
| |
| bool | runAxialCalibration () |
| | Calibrate the assembly's vertical axis using the upper proximity sensor. More...
|
| |
| 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, the function forces -1. It then changes the pin output to the motor accordingly. More...
|
| |
| void | setEnableDrive (bool driveValue) |
| |
| int | getMotorState () |
| | gets the motor current state. More...
|
| |
| int | getDriveState () |
| |
| int | getProximitySensorPin (bool sensorNumber) |
| | Gives the proximity sensor pin number on the arduino. More...
|
| |
| int | getProximitySensorValue (bool sensorNumber) |
| | Gives a sensor value. All proximity sensors are pulled up. More...
|
| |
| int | getMotorPin (int directionNumber) |
| | Gives the chosen motor direction pin. More...
|
| |
| int | getDrivePin () |
| |
Definition at line 2 of file axialMotor.h.
| axialMotor::axialMotor |
( |
int |
enAPinValue, |
|
|
int |
motorInitialState, |
|
|
int |
pinCWOutputValue, |
|
|
int |
pinCCWOutputValue, |
|
|
int |
ProxSensor1Value, |
|
|
int |
ProxSensor2Value |
|
) |
| |
Construct the axial motor with initial states/pinout.
- Parameters
-
| motorInitialState | : Motor start state (0,1,-1). 0 means going CCW, 1 CW and -1 STOP. |
| ProxSensor1Value | : Pin value of the first proximity sensor |
| ProxSensor2Value | : Pin value of the second proximity sensor |
Definition at line 32 of file axialMotor.h.
| axialMotor::axialMotor |
( |
| ) |
|
Construct the axial motor with no initial states/pinout. Motor state is then set to STOP (-1), and proximity sensor pinout to 51 and 53 by default.
Definition at line 46 of file axialMotor.h.
| int axialMotor::getDrivePin |
( |
| ) |
|
| int axialMotor::getDriveState |
( |
| ) |
|
| int axialMotor::getMotorPin |
( |
int |
directionNumber | ) |
|
Gives the chosen motor direction pin.
- Parameters
-
| directionNumber | : int value corresponding to the direction of the motor in the assembly. 1 is the clockwise direction, 2, the counterclockwise direction. |
- Returns
- int : actual value of the pin.
Definition at line 216 of file axialMotor.h.
| int axialMotor::getMotorState |
( |
| ) |
|
gets the motor current state.
- Returns
- int : current state value of the motor.
Definition at line 173 of file axialMotor.h.
| int axialMotor::getProximitySensorPin |
( |
bool |
sensorNumber | ) |
|
Gives the proximity sensor pin number on the arduino.
- Parameters
-
| sensorNumber | : Boolean value corresponding to the sensor number in the assembly. 1 is the top sensor, 2, the bottom sensor. |
- Returns
- int : Returns the pin number.
Definition at line 182 of file axialMotor.h.
| int axialMotor::getProximitySensorValue |
( |
bool |
sensorNumber | ) |
|
Gives a sensor value. All proximity sensors are pulled up.
- Parameters
-
| sensorNumber | : Boolean value corresponding to the sensor number in the assembly. 1 is the top sensor, 2, the bottom sensor. |
- Returns
- int : actual value given off by the sensor.
Definition at line 199 of file axialMotor.h.
| bool axialMotor::runAxialCalibration |
( |
| ) |
|
Calibrate the assembly's vertical axis using the upper proximity sensor.
- Parameters
-
| motorInitialState | : Motor start state (0,1,-1). 0 means going CCW, 1 CW and -1 STOP. |
| ProxSensor1Value | : Pin value of the first proximity sensor. |
| ProxSensor2Value | : Pin value of the second proximity sensor. |
- Returns
- bool : Boolean value verifying the end of the calibration sequence.
Definition at line 107 of file axialMotor.h.
| void axialMotor::setEnableDrive |
( |
bool |
driveValue | ) |
|
| void axialMotor::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, the function forces -1. It then changes the pin output to the motor accordingly.
- Parameters
-
| StateValue | : value confirming if the motor should slow down or not. |
Definition at line 126 of file axialMotor.h.
| bool axialMotor::shouldSlowDown |
( |
| ) |
|
Checks if the requirement to make the motor stop are met. /return bool : value confirming if the motor should slow down or not.
Definition at line 60 of file axialMotor.h.
| int axialMotor::motorState |
|
private |
| int axialMotor::pinCCWOutput |
|
private |
| int axialMotor::pinCWOutput |
|
private |
| int axialMotor::proximitySensor1Pin |
|
private |
| int axialMotor::proximitySensor2Pin |
|
private |
The documentation for this class was generated from the following file: