RoboAide
Project to improve a DIY robotic arm used for mobility assistance
Public Member Functions | Private Attributes | List of all members
axialMotor Class Reference

#include <axialMotor.h>

Public Member Functions

 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 ()
 

Private Attributes

int motorState
 
int enAPin
 
int pinCWOutput
 
int pinCCWOutput
 
int proximitySensor1Pin
 
int proximitySensor2Pin
 

Detailed Description

Definition at line 2 of file axialMotor.h.

Constructor & Destructor Documentation

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.

Member Function Documentation

int axialMotor::getDrivePin ( )

Definition at line 254 of file axialMotor.h.

int axialMotor::getDriveState ( )

Definition at line 249 of file axialMotor.h.

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)

Definition at line 233 of file axialMotor.h.

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.

Member Data Documentation

int axialMotor::enAPin
private

Definition at line 20 of file axialMotor.h.

int axialMotor::motorState
private

Definition at line 19 of file axialMotor.h.

int axialMotor::pinCCWOutput
private

Definition at line 22 of file axialMotor.h.

int axialMotor::pinCWOutput
private

Definition at line 21 of file axialMotor.h.

int axialMotor::proximitySensor1Pin
private

Definition at line 23 of file axialMotor.h.

int axialMotor::proximitySensor2Pin
private

Definition at line 24 of file axialMotor.h.


The documentation for this class was generated from the following file: