mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Version 4 Image
Updated the HAL library to work with the new version 3 headers from NI. There were multiple changes in this verison: more PWM generators were added, so the functions for setting PWM signals have been updated. UserWatchdog has been removed, and Watchdog has been removed from WPILib to accomodate for this. Digital selection has been consolidated to one function in the NI headers, so this has been updated in the HAL. New SPI and I2C libraries have been added, but need to be implemented in the HAL before they will work.
This commit is contained in:
committed by
Brad Miller
parent
b1ef116104
commit
4546abc8c5
@@ -1,31 +1,35 @@
|
||||
|
||||
#include "$classname.h"
|
||||
#include "../Robotmap.h"
|
||||
#include "../RobotMap.h"
|
||||
#include "SmartDashboard/SmartDashboard.h"
|
||||
#include "LiveWindow/LiveWindow.h"
|
||||
|
||||
#@autogenerated_code("pid", "")
|
||||
#parse("${exporter-path}PIDSubsystem-pid.cpp")
|
||||
#end
|
||||
$classname::$classname() : PIDSubsystem("$classname", 1.0, 0.0, 0.0) {
|
||||
$classname::$classname() :
|
||||
PIDSubsystem("$classname", 1.0, 0.0, 0.0)
|
||||
{
|
||||
// Use these to get going:
|
||||
// SetSetpoint() - Sets where the PID controller should move the system
|
||||
// to
|
||||
// Enable() - Enables the PID controller.
|
||||
}
|
||||
|
||||
double $classname::ReturnPIDInput() {
|
||||
double $classname::ReturnPIDInput()
|
||||
{
|
||||
// Return your input value for the PID loop
|
||||
// e.g. a sensor, like a potentiometer:
|
||||
// yourPot->SetAverageVoltage() / kYourMaxVoltage;
|
||||
}
|
||||
|
||||
void $classname::UsePIDOutput(double output) {
|
||||
void $classname::UsePIDOutput(double output)
|
||||
{
|
||||
// Use output to drive your system, like a motor
|
||||
// e.g. yourMotor->Set(output);
|
||||
}
|
||||
|
||||
void $classname::InitDefaultCommand() {
|
||||
void $classname::InitDefaultCommand()
|
||||
{
|
||||
// Set the default command for a subsystem here.
|
||||
//setDefaultCommand(new MySpecialCommand());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user