Add SPARK and SD540 motor controllers

Change-Id: I33f9c588b6d535b1f274d211563ef146f34439b1
This commit is contained in:
Kevin O'Connor
2015-12-11 16:37:53 -05:00
parent 9316933454
commit fa903dd9ce
7 changed files with 486 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2008. All Rights Reserved.
*/
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */
/*----------------------------------------------------------------------------*/
#pragma once
#include "SafePWM.h"
#include "SpeedController.h"
#include "PIDOutput.h"
/**
* REV Robotics Speed Controller
*/
class Spark : public SafePWM, public SpeedController {
public:
explicit Spark(uint32_t channel);
virtual ~Spark() = default;
virtual void Set(float value, uint8_t syncGroup = 0) override;
virtual float Get() const override;
virtual void Disable() override;
virtual void PIDWrite(float output) override;
virtual void SetInverted(bool isInverted) override;
virtual bool GetInverted() const override;
private:
bool m_isInverted = false;
};