RIT VEXU Core API
Toggle main menu visibility
Loading...
Searching...
No Matches
basic_command.h
1
14
#pragma once
15
16
#include "core/utils/command_structure/auto_command.h"
17
18
// Basic Motor Classes-----------------------------------------------
19
24
class
BasicSpinCommand
:
public
AutoCommand {
25
public
:
26
// Enumurator for the type of power setting in the motor
27
enum
type { percent, voltage, velocity };
28
37
BasicSpinCommand
(vex::motor &motor, vex::directionType dir, BasicSpinCommand::type setting,
double
power);
38
45
bool
run
()
override
;
46
47
/*
48
* Returns a string describing the commands functionality
49
*/
50
std::string toString()
override
;
51
52
private
:
53
vex::motor &motor;
54
55
type setting;
56
57
vex::directionType dir;
58
59
double
power;
60
};
61
65
class
BasicStopCommand
:
public
AutoCommand {
66
public
:
73
BasicStopCommand
(vex::motor &motor, vex::brakeType setting);
74
81
bool
run
()
override
;
82
83
/*
84
* Returns a string describing the commands functionality
85
*/
86
std::string toString()
override
;
87
88
private
:
89
vex::motor &motor;
90
91
vex::brakeType setting;
92
};
93
94
// Basic Solenoid Commands----------------------------------
95
100
class
BasicSolenoidSet
:
public
AutoCommand {
101
public
:
108
BasicSolenoidSet
(vex::pneumatics &solenoid,
bool
setting);
109
116
bool
run
()
override
;
117
/*
118
* Returns a string describing the commands functionality
119
*/
120
std::string toString()
override
;
121
122
private
:
123
vex::pneumatics &solenoid;
124
125
bool
setting;
126
};
BasicSolenoidSet::run
bool run() override
Runs the BasicSolenoidSet Overrides run command from AutoCommand.
Definition
basic_command.cpp:121
BasicSolenoidSet::BasicSolenoidSet
BasicSolenoidSet(vex::pneumatics &solenoid, bool setting)
Construct a new BasicSolenoidSet Command.
Definition
basic_command.cpp:113
BasicSpinCommand::run
bool run() override
Runs the BasicSpinCommand Overrides run from Auto Command.
Definition
basic_command.cpp:36
BasicSpinCommand::BasicSpinCommand
BasicSpinCommand(vex::motor &motor, vex::directionType dir, BasicSpinCommand::type setting, double power)
Construct a new BasicSpinCommand.
Definition
basic_command.cpp:25
BasicStopCommand::BasicStopCommand
BasicStopCommand(vex::motor &motor, vex::brakeType setting)
Construct a new BasicMotorStop Command.
Definition
basic_command.cpp:77
BasicStopCommand::run
bool run() override
Runs the BasicMotorStop Command Overrides run command from AutoCommand.
Definition
basic_command.cpp:85
include
core
utils
command_structure
basic_command.h
Generated by
1.17.0