Skip to content

Commit

Permalink
Change debounces to Rising, make stalling debounce RC
Browse files Browse the repository at this point in the history
  • Loading branch information
BenG49 committed Jan 26, 2024
1 parent 9905153 commit 1b021ee
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import com.stuypulse.robot.constants.Settings;
import com.stuypulse.stuylib.streams.booleans.BStream;
import com.stuypulse.stuylib.streams.booleans.filters.BDebounce;

import com.stuypulse.stuylib.streams.booleans.filters.BDebounceRC;
import com.revrobotics.CANSparkMax;
import com.revrobotics.CANSparkLowLevel.MotorType;

Expand All @@ -26,8 +26,11 @@ public IntakeImpl() {

Motors.Intake.MOTOR_CONFIG.configure(motor);

triggered = BStream.create(sensor).not().filtered(new BDebounce.Both(Settings.Intake.Detection.TRIGGER_TIME));
stalling = BStream.create(this::isMomentarilyStalling).filtered(new BDebounce.Both(Settings.Intake.Detection.STALL_TIME));
triggered = BStream.create(sensor).not()
.filtered(new BDebounce.Rising(Settings.Intake.Detection.TRIGGER_TIME));

stalling = BStream.create(this::isMomentarilyStalling)
.filtered(new BDebounceRC.Rising(Settings.Intake.Detection.STALL_TIME));
}

@Override
Expand Down

0 comments on commit 1b021ee

Please sign in to comment.