blob: 875fec1d42514240354ba0638d89b481ab19e039 [file] [log] [blame]
Brian Silverman41cdd3e2019-01-19 19:48:58 -08001/*----------------------------------------------------------------------------*/
2/* Copyright (c) 2017-2018 FIRST. All Rights Reserved. */
3/* Open Source Software - may be modified and shared by FRC teams. The code */
4/* must be accompanied by the FIRST BSD license file in the root directory of */
5/* the project. */
6/*----------------------------------------------------------------------------*/
7
8#include "MockSpeedController.h"
9
10using namespace frc;
11
12void MockSpeedController::Set(double speed) {
13 m_speed = m_isInverted ? -speed : speed;
14}
15
16double MockSpeedController::Get() const { return m_speed; }
17
18void MockSpeedController::SetInverted(bool isInverted) {
19 m_isInverted = isInverted;
20}
21
22bool MockSpeedController::GetInverted() const { return m_isInverted; }
23
24void MockSpeedController::Disable() { m_speed = 0; }
25
26void MockSpeedController::StopMotor() { Disable(); }
27
28void MockSpeedController::PIDWrite(double output) { Set(output); }