WPILibC++  unspecified
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Pages
Jaguar.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) FIRST 2008-2016. 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 #pragma once
9 
10 #include "SafePWM.h"
11 #include "SpeedController.h"
12 #include "PIDOutput.h"
13 
17 class Jaguar : public SafePWM, public SpeedController {
18  public:
19  explicit Jaguar(uint32_t channel);
20  virtual ~Jaguar() = default;
21  virtual void Set(float value, uint8_t syncGroup = 0) override;
22  virtual float Get() const override;
23  virtual void Disable() override;
24  virtual void StopMotor() override;
25 
26  virtual void PIDWrite(float output) override;
27  virtual void SetInverted(bool isInverted) override;
28  virtual bool GetInverted() const override;
29 
30  private:
31  bool m_isInverted = false;
32 };
A safe version of the PWM class.
Definition: SafePWM.h:25
Luminary Micro / Vex Robotics Jaguar Speed Controller with PWM control.
Definition: Jaguar.h:17
Jaguar(uint32_t channel)
Constructor for a Jaguar connected via PWM.
Definition: Jaguar.cpp:16
virtual void Set(float value, uint8_t syncGroup=0) override
Set the PWM value.
Definition: Jaguar.cpp:44
virtual float Get() const override
Get the recently set value of the PWM.
Definition: Jaguar.cpp:53
virtual void PIDWrite(float output) override
Write out the PID value as seen in the PIDOutput base object.
Definition: Jaguar.cpp:79
Interface for speed controlling devices.
Definition: SpeedController.h:16
virtual bool GetInverted() const override
Common interface for the inverting direction of a speed controller.
Definition: Jaguar.cpp:72
virtual void StopMotor() override
Common interface to stop the motor until Set is called again.
Definition: Jaguar.cpp:84
virtual void SetInverted(bool isInverted) override
Common interface for inverting direction of a speed controller.
Definition: Jaguar.cpp:64
virtual void Disable() override
Common interface for disabling a motor.
Definition: Jaguar.cpp:58