public class MotorGroup
extends java.lang.Object
implements edu.wpi.first.wpilibj.SpeedController
Constructor and Description |
---|
MotorGroup()
Creates a MotorGroup.
|
MotorGroup(edu.wpi.first.wpilibj.SpeedController... motorArray)
Creates a MotorGroup that consists of motorArray's Motors.
|
Modifier and Type | Method and Description |
---|---|
MotorGroup |
addMotors(edu.wpi.first.wpilibj.SpeedController... moreMotors)
Adds Motors to this MotorGroup.
|
void |
clearMotors()
Clears the list of Motors.
|
void |
disable() |
void |
forEach(java.util.function.Consumer<edu.wpi.first.wpilibj.SpeedController> c)
Calls code on each Motor in this MotorGroup.
|
double |
get() |
boolean |
getInverted() |
int |
getMotorCount()
Gets how many motors are in this MotorGroup.
|
java.util.List<edu.wpi.first.wpilibj.SpeedController> |
getMotors()
Gets all the motors in this MotorGroup.
|
boolean |
isLoggingChanges()
Checks if this MotorGroup is logging changes in power.
|
void |
pidWrite(double v) |
void |
set(double d) |
void |
setInverted(boolean reversed) |
MotorGroup |
setInverts(java.lang.Boolean... newInverts)
Sets the invert statuses of all the Motors in this MotorGroup.
|
void |
setLoggingChanges(boolean b)
Sets if this MotorGroup should be logging changes in power.
|
void |
stopMotor() |
void |
testEach(double power,
double timeOn)
Tests each Motor in this MotorGroup.
|
void |
testEachWait(double power,
double timeOn)
Tests each Motor in this MotorGroup, and freezes the Thread until the test is complete.
|
public MotorGroup()
public MotorGroup(edu.wpi.first.wpilibj.SpeedController... motorArray)
motorArray
- The Motors to be a part of this MotorGroup.public MotorGroup addMotors(edu.wpi.first.wpilibj.SpeedController... moreMotors)
moreMotors
- The Motors to be added.public void clearMotors()
public MotorGroup setInverts(java.lang.Boolean... newInverts)
newInverts
- All the new invert statuses. Must be the same length as the motor list.public void forEach(java.util.function.Consumer<edu.wpi.first.wpilibj.SpeedController> c)
c
- The code to call.public void testEach(double power, double timeOn)
power
- The speed the Motor will run at while being tested.timeOn
- How long the Motor will be on while being tested.public void testEachWait(double power, double timeOn)
power
- The speed the Motor will run at while being tested.timeOn
- How long the Motor will be on while being tested.public boolean isLoggingChanges()
public void setLoggingChanges(boolean b)
b
- If this MotorGroup is logging changes in power.public java.util.List<edu.wpi.first.wpilibj.SpeedController> getMotors()
public int getMotorCount()
public void set(double d)
set
in interface edu.wpi.first.wpilibj.SpeedController
public double get()
get
in interface edu.wpi.first.wpilibj.SpeedController
public void setInverted(boolean reversed)
setInverted
in interface edu.wpi.first.wpilibj.SpeedController
public boolean getInverted()
getInverted
in interface edu.wpi.first.wpilibj.SpeedController
public void disable()
disable
in interface edu.wpi.first.wpilibj.SpeedController
public void stopMotor()
stopMotor
in interface edu.wpi.first.wpilibj.SpeedController
public void pidWrite(double v)
pidWrite
in interface edu.wpi.first.wpilibj.PIDOutput