1516b Over Under 2.0
Codebase for 1516b over under season
|
Represents a Puncher mechanism for a robot. More...
#include <puncher.h>
Public Member Functions | |
void | run (int autonVal) |
Runs the puncher based on the given autonomous value. | |
void | setDistancePuncher (bool punch) |
Sets the distancePuncher variable based on the punch parameter. | |
void | PuncherSwitch () |
Toggles whether the distance sensor is activated or not and prints it out. | |
Private Member Functions | |
int | toShoot () |
Checks if the distance sensor is connected and whether to shoot. | |
Private Attributes | |
bool | distancePuncher |
Determines whether to use the distance sensor or not. | |
Represents a Puncher mechanism for a robot.
The Puncher class provides functionality to control a puncher mechanism on a robot. It allows running the puncher based on an autonomous value, setting the distancePuncher variable, toggling the distance sensor activation, and checking whether to shoot or not.
void Puncher::PuncherSwitch | ( | ) |
Toggles whether the distance sensor is activated or not and prints it out.
This function toggles the distance sensor activation by flipping the value of the distancePuncher variable. It then prints out the current state of the distancePuncher variable.
Definition at line 55 of file puncher.cpp.
References Robot::Globals::controller, distancePuncher, and setDistancePuncher().
Referenced by Robot::Utility::toggleSubsystemOptions().
void Puncher::run | ( | int | autonVal | ) |
Runs the puncher based on the given autonomous value.
This function executes the puncher mechanism based on the provided autonomous value. It contains conditionals that determine the behavior of the puncher.
autonVal | The autonomous value to determine the puncher behavior. |
Definition at line 15 of file puncher.cpp.
References Robot::Globals::controller, distancePuncher, Robot::Globals::punchers, and toShoot().
Referenced by Robot::Autonomous::Auton3(), and opcontrol().
void Puncher::setDistancePuncher | ( | bool | punch | ) |
Sets the distancePuncher variable based on the punch parameter.
This function sets the distancePuncher variable based on the provided punch parameter. The distancePuncher variable determines the behavior of the puncher mechanism.
punch | The value to set the distancePuncher variable to. |
Definition at line 10 of file puncher.cpp.
References distancePuncher.
Referenced by PuncherSwitch().
|
private |
Checks if the distance sensor is connected and whether to shoot.
This function checks if the distance sensor is connected and retrieves the distance from the triball. It uses the distance to determine whether to shoot or not.
Definition at line 40 of file puncher.cpp.
References Robot::Globals::distance, and distancePuncher.
Referenced by run().
|
private |
Determines whether to use the distance sensor or not.
The distancePuncher variable decides whether to use the distance sensor or not. If distancePuncher is true, the distance sensor is used. If it is false, the distance sensor is not used.
Definition at line 61 of file puncher.h.
Referenced by PuncherSwitch(), run(), setDistancePuncher(), and toShoot().