# Motor Group

```cpp
UvuvMotorGroup(std::vector<UvuvMotor*> motorContainerArg)
```

~~**motorContainerArg - A Vector of pointers to Motors that you wish to be part of the Motor Group**~~

~~Not Yet Implemented~~

```cpp
UvuvMotorGroup(std::vector<std::pair<int, motorRotation>> motorParameters);
```

~~Not Yet Implemented~~

### spinAtVoltage

*Spins the all of the motors at the provided voltage*&#x20;

```cpp
void spinAtVoltage(int voltage)
```

**voltage** - An integer between -12000 and 12000. This number determines the voltage that the motors will spin at

### spinJoystick

*Spins the all of the motors in increments of 1/127 of its total power*&#x20;

```cpp
void spinJoystick(int joystickValue)
```

**joystickValue** - An integer between -127 and 127 that determines the power that the motors will spin at. This value would be the same one returned by a Joystick, hence the name of the function

### spinPerc

*Spins the all of the motors as a percentage of their total power*

<pre class="language-cpp"><code class="lang-cpp"><strong>void spinPerc(int percent) 
</strong></code></pre>

**percent** - the percentage of the Total Power of the motors. Takes in an integer value between -100 to 100

### spinPercVEXPID

*Uses VEX Built in PID. Spins all of the motors as a percentage of their total power. (DO NOT USE WITH PID)*

```cpp
void spinPercVEXPID(int percent)
```

**percent** - the fraction of the Total Power of the motors. Takes in an integer value between -127 to 127.

### spinAtRPM

*Spins all of the motors at the given RPM.*

```cpp
void spinAtRPM(int RPM)
```

**RPM** - The Rotations Per Minute you desire the motors to move. Works through the PID Controller, so make sure that you assign one to this MotorGroup before using it.

### spinUntilDegree

*Spins all of the motors around for how many degrees you provide them.*&#x20;

```cpp
void UvuvMotor::spinUntilDegree(int degree, int speedInVoltage)
```

**degree** - the amount of degrees you want the motors to spin.

**speedInVoltage** - An integer between -12000 and 12000. This number determines the voltage that the motors will spin at.

### spinFor

*Spins all of the motors for how many seconds you tell them to.*

```cpp
void spinFor(float seconds, int speedInVoltage)
```

**seconds** - the amount of time in seconds that the motors will spin for

**speedInVoltage** - An integer between -12000 and 12000. This number determines the voltage that the motors will spin at.

### ~~logMotorPreference~~

*Not yet Implemented*

### set\_zero\_position

*Sets the position of the all of the Motors.*

```cpp
void set_zero_position(int position)
```

**position** - Sets the absolute position of the motors to position

### shutDown

*Shuts down all of the Motors.*

```cpp
void shutDown()
```

###

### Revive

*Enables all of the Motors.*

```cpp
void revive()
```

### getIsBroken

*Returns a Vector of each Motors' isBroken states.*

```cpp
std::vector<bool> getIsBroken()
```

### getIndividualRPM

*Returns a Vector of each Motors' Rotations Per Minute.*

```cpp
std::vector<float> getIndividualRPM()
```

### getAverageRPM

*Returns the average Rotations Per Minute the Motors are doing now.*

```cpp
float getAverageRPM()
```

### getVoltage

*Returns the average Voltage of the Motors*

```cpp
float getVoltage()
```

### getDrivePID

*Returns a Pointer to the DrivePID*

```cpp
PIDController* getDrivePID()
```

### getTurnPID

*Returns a Pointer to the TurnPID*

```cpp
PIDController* getTurnPID()
```

### assignDrivePID

~~*(Uvuv Comment) - both this function and the one bellow do not return True or False. Either make the function void or have it return an error state as true or false*~~&#x20;

*Assigns the DrivePID, given a PIDController*

```cpp
bool assignDrivePID(PIDController pid)
```

**pid** - A PIDController you wish to become the DrivePID of this Motor Group

### assignTurnPID

*Assigns the TurnPID, given a PIDController.*&#x20;

```cpp
bool assignTurnPID(PIDController pid)
```

**pid** - A PIDController you wish to become the TurnPID of this Motor Group.

### getAverageEncoderPositions

*Gets the average encoder Positions of the Motors in degrees.*

```cpp
float getAverageEncoderPositions()
```
