ART v1.0-alpha
A Robot Template that raises the floor for VRC teams
Loading...
Searching...
No Matches
SimpleMotor.h
Go to the documentation of this file.
1
15#pragma once
16
17#include "vex.h"
18
19namespace art
20{
21
36 class SimpleMotor : public vex::motor
37 {
38 public:
53 SimpleMotor(vex::motor mot);
54
94 SimpleMotor &withSpeedMode(bool speedMode);
95
111 void setSpeedMode(bool speedMode);
112
122 bool getSpeedMode();
123
148 void set(double cmd);
149
163 double get();
164
165 private:
179 double m_cmd{0};
180
195 bool m_speedMode{false};
196 };
197
198} // namespace ART
A Simple Motor Wrapper Class.
Definition SimpleMotor.h:37
SimpleMotor(vex::motor mot)
Construct a new Simple Motor object.
void set(double cmd)
Sets the motor to spin at the specified command.
void setSpeedMode(bool speedMode)
Set the SpeedMode of the SimpleMotor.
bool getSpeedMode()
Get the SpeedMode of the SimpleMotor.
bool m_speedMode
Whether or not the motor should use speed, rather than voltage.
double get()
Returns the command the motor was last commanded to.
double m_cmd
The command the motor is set to, as a percentage of the max.
SimpleMotor & withSpeedMode(bool speedMode)
Returns a SimpleMotor refrence with the specified speedMode.
Definition PID.h:20
The include file for the Vex Library.