Now you can download a copy of these docs so you can use them offline! Download now
Victor.cpp
00001 /*----------------------------------------------------------------------------*/ 00002 /* Copyright (c) FIRST 2008. All Rights Reserved. */ 00003 /* Open Source Software - may be modified and shared by FRC teams. The code */ 00004 /* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */ 00005 /*----------------------------------------------------------------------------*/ 00006 00007 #include "Victor.h" 00008 #include "DigitalModule.h" 00009 00026 void Victor::InitVictor() 00027 { 00028 // TODO: compute the appropriate values based on digital loop timing 00029 SetBounds(210, 138, 132, 126, 56); 00030 SetPeriodMultiplier(kPeriodMultiplier_2X); 00031 SetRaw(m_centerPwm); 00032 } 00033 00039 Victor::Victor(UINT32 channel) : SafePWM(channel) 00040 { 00041 InitVictor(); 00042 } 00043 00050 Victor::Victor(UINT8 moduleNumber, UINT32 channel) : SafePWM(moduleNumber, channel) 00051 { 00052 InitVictor(); 00053 } 00054 00055 Victor::~Victor() 00056 { 00057 } 00058 00068 void Victor::Set(float speed, UINT8 syncGroup) 00069 { 00070 SetSpeed(speed); 00071 } 00072 00078 float Victor::Get() 00079 { 00080 return GetSpeed(); 00081 } 00082 00086 void Victor::Disable() 00087 { 00088 SetRaw(kPwmDisabled); 00089 } 00090 00096 void Victor::PIDWrite(float output) 00097 { 00098 Set(output); 00099 } 00100
Generated on Thu Jan 12 2012 22:35:25 for WPILibC++ by
1.7.1