1516b Over Under 2.0
Codebase for 1516b over under season
Loading...
Searching...
No Matches
Robot::Wings Class Reference

The Wings class represents the wings of a robot. More...

#include <wings.h>

Public Member Functions

void run ()
 Runs the wings.
 
void setState (bool wingState)
 Sets the state of the wings.
 
bool getState ()
 Gets the current state of the wings.
 

Private Attributes

bool state
 

Detailed Description

The Wings class represents the wings of a robot.

The Wings class provides functionality to control and operate the wings of a robot. It allows the robot to perform various actions related to the wings, such as running them.

Definition at line 11 of file wings.h.

Member Function Documentation

◆ getState()

bool Robot::Wings::getState ( )

Gets the current state of the wings.

Returns
The current state of the wings.

Definition at line 27 of file wings.cpp.

27 {
28 return state;
29}
bool state
Definition wings.h:42

References state.

◆ run()

void Robot::Wings::run ( )

Runs the wings.

This function activates the wings and starts their operation. It allows the robot to perform actions that involve the movement or control of the wings.

Note
Make sure to initialize the wings before calling this function.

Definition at line 7 of file wings.cpp.

7 {
8 if(controller.get_digital_new_press(pros::E_CONTROLLER_DIGITAL_B)) {
9 state = !state;
10 }
11 if (state) {
12 wing.set_value(true);
13 wing2.set_value(false);
15 }
16 else {
17 wing.set_value(false);
18 wing2.set_value(true);
20 }
21}
void setState(bool wingState)
Sets the state of the wings.
Definition wings.cpp:23
pros::Controller controller
pros::ADIDigitalOut wing2
pros::ADIDigitalOut wing

References Robot::Globals::controller, setState(), state, Robot::Globals::wing, and Robot::Globals::wing2.

Referenced by opcontrol().

◆ setState()

void Robot::Wings::setState ( bool wingState)

Sets the state of the wings.

Parameters
wingStateThe state of the wings.

Definition at line 23 of file wings.cpp.

23 {
24 state = wingState;
25}

References state.

Referenced by run().

Member Data Documentation

◆ state

bool Robot::Wings::state
private

The current state of the wings. The state variable represents the current state of the wings. It can be either true or false, indicating whether the wings are activated or deactivated. This variable is used to control the behavior of the wings and to query their current state.

Definition at line 42 of file wings.h.

Referenced by getState(), run(), and setState().


The documentation for this class was generated from the following files: