|
LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
|
Robot subsystem declarations: motors, sensors, and pistons. More...
Go to the source code of this file.
Functions | |
Motors | |
Syntax: inline pros::Motor name(PORT); // forward
inline pros::Motor name(-PORT); // negative port = reversed
inline pros::MotorGroup name({A, -B}); // group multiple motors
Useful methods:
| |
| pros::Motor | Top (7) |
| pros::Motor | Bottom (17) |
| pros::MotorGroup | Score ({17, 7}) |
| Top + Bottom together. | |
| pros::Motor | turret (0) |
| Set port to 0 if not installed. | |
| pros::Optical | optical (15) |
| Optical sensor for color sorting. | |
Variables | |
| Drive | chassis |
| The drive chassis, configured in main.cpp and used everywhere else. | |
Pistons (ADI / 3-wire) | |
Syntax: ‘inline light::Piston name('PORT’);
| |
| light::Piston | Wings ('A') |
| Intake wings / expander. | |
| light::Piston | Loader ('C') |
| Ball loader / indexer. | |
| light::Piston | MidGoal ('D') |
| Mid-goal clamp or mechanism. | |
| light::Piston | Hood ('E') |
| Scoring hood. | |
Alliance color | |
Set
| |
| enum | Colors { BLUE = 0 , NEUTRAL = 1 , RED = 2 } |
| Alliance color enum used by the color-sort logic. More... | |
| Colors | allianceColor |
| Currently active alliance color. | |
Lift with rotational snapping | |
A motor + rotation sensor pair that snaps to the nearest preset angle when the operator stops driving it. While To use: replace port 0 with your real motor / rotation-sensor ports, then edit the snap angles (degrees) to match your mechanism's rest stops. | |
| light::RotationalSnap | Lift (LiftMotor, LiftRot, {0.0, 45.0, 90.0, 135.0, 180.0}, 1.5, 1.0, 80) |
| Lift assembly: snaps to {0, 45, 90, 135, 180}° at rest. | |
| pros::Motor | LiftMotor (0) |
| 0 = disabled until you set the port. | |
| pros::Rotation | LiftRot (0) |
| Rotation sensor on the lift axis. | |
Robot subsystem declarations: motors, sensors, and pistons.
Everything declared inline here is available in every .cpp file that includes this header — no extern declarations needed elsewhere.
The drive chassis is declared in main.cpp (built from the #defines at the top of that file) and re-exposed here as extern Drive chassis.
Definition in file subsystems.hpp.
| enum Colors |
Alliance color enum used by the color-sort logic.
| Enumerator | |
|---|---|
| BLUE | |
| NEUTRAL | |
| RED | |
Definition at line 96 of file subsystems.hpp.
|
inline |
|
inline |
0 = disabled until you set the port.
|
inline |
Rotation sensor on the lift axis.
|
inline |
Optical sensor for color sorting.
|
inline |
Top + Bottom together.
|
inline |
|
inline |
Set port to 0 if not installed.
|
extern |
Currently active alliance color.
|
extern |
The drive chassis, configured in main.cpp and used everywhere else.
|
inline |
Scoring hood.
|
inline |
Lift assembly: snaps to {0, 45, 90, 135, 180}° at rest.
|
inline |
Ball loader / indexer.
|
inline |
Mid-goal clamp or mechanism.
|
inline |
Intake wings / expander.