Skip to content

Commit

Permalink
Merge pull request #6 from SaintsRobotics/motorgroupfix
Browse files Browse the repository at this point in the history
change MotorGroup to implement Motor
  • Loading branch information
PrecociouslyDigital authored Feb 11, 2018
2 parents 101d1f9 + 8f23533 commit 83fc03d
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/main/java/com/github/dozer/output/MotorGroup.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import java.util.ArrayList;
import java.util.List;

public class MotorGroup {
public class MotorGroup implements Motor{

private Motor[] motors;

Expand All @@ -23,10 +23,23 @@ public MotorGroup(MotorGroup... motorGroups) {
motors = motorList.toArray(new Motor[0]);
}

@Override
public void set(double speed) {
for (Motor motor : motors) {
motor.set(speed);
}
}

@Override
public double get(){
return motors[0].get();
}

@Override
public void stop() {
for (Motor motor : motors) {
motor.stop();
}
}

}

0 comments on commit 83fc03d

Please sign in to comment.