Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conveyor #6

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Conveyor #6

wants to merge 8 commits into from

Conversation

GaiaZano05
Copy link

Motors: TalonSRX- motor, Solenoid- stopper.
Sensors: AnalogInput- funnelProximity, AnalogInput- shooterProximity.

The code is responsible for the movment of the conveyor.

Copy link

@vichik123 vichik123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code looks great, well done

*
* @param power %
*/
public void setMotor(double power) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename to setPower

* @return boolean sensed.
*/
public boolean senseShooterBall() {
return shooterProximity.getValue() > Constants.Conveyor.MIN_PROXIMITY_DISTANCE;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check if the value is between, min and max, in case the sensor has an error

}

@Override
public void end(boolean interrupted) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stop the motor in the end method

Copy link

@orel-david orel-david left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general great job, there are some small things but great job.

Comment on lines +20 to +22
public static final int SENSE_DISTANCE = 0;
public static final int MIN_PROXIMITY_DISTANCE = 0;
public static final int MAX_PROXIMITY_DISTANCE = 0;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add units for each constant

}

/**
* Add boolean stopper open/ close.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method doesn't add a boolean, it checks whether the stopper is open or not.

Comment on lines +24 to +25
public static final boolean NEW_SHOOTER_BALL = false;
public static final boolean NEW_FUNNEL_BALL = false;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are those neccessary?

Comment on lines +93 to +96
newFunnelBall = false;
} else {
newFunnelBall = true;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should tell if this is a new ball by checking if the sensor stopped sensing one.

this.conveyor = conveyor;
this.power = power;
addRequirements(conveyor);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

this.conveyor = conveyor;
this.power = power;
addRequirements(conveyor);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

public void execute() {
if (conveyor.senseFunnelBall() && conveyor.getBallNum() <= Constants.Conveyor.MAX_BALLS) {
conveyor.setMotor(power);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

public SetStopperMode(Conveyor conveyor, boolean open) {
this.conveyor = conveyor;
this.open = open;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants