Now you can download a copy of these docs so you can use them offline! Download now
Jaguar.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 00008 #include "Jaguar.h" 00009 #include "DigitalModule.h" 00010 00014 void Jaguar::InitJaguar() 00015 { 00016 /* 00017 * Input profile defined by Luminary Micro. 00018 * 00019 * Full reverse ranges from 0.671325ms to 0.6972211ms 00020 * Proportional reverse ranges from 0.6972211ms to 1.4482078ms 00021 * Neutral ranges from 1.4482078ms to 1.5517922ms 00022 * Proportional forward ranges from 1.5517922ms to 2.3027789ms 00023 * Full forward ranges from 2.3027789ms to 2.328675ms 00024 * TODO: compute the appropriate values based on digital loop timing 00025 */ 00026 SetBounds(251, 135, 128, 120, 4); 00027 SetPeriodMultiplier(kPeriodMultiplier_1X); 00028 SetRaw(m_centerPwm); 00029 } 00030 00036 Jaguar::Jaguar(UINT32 channel) : SafePWM(channel) 00037 { 00038 InitJaguar(); 00039 } 00040 00047 Jaguar::Jaguar(UINT8 moduleNumber, UINT32 channel) : SafePWM(moduleNumber, channel) 00048 { 00049 InitJaguar(); 00050 } 00051 00052 Jaguar::~Jaguar() 00053 { 00054 } 00055 00065 void Jaguar::Set(float speed, UINT8 syncGroup) 00066 { 00067 SetSpeed(speed); 00068 } 00069 00075 float Jaguar::Get() 00076 { 00077 return GetSpeed(); 00078 } 00079 00083 void Jaguar::Disable() 00084 { 00085 SetRaw(kPwmDisabled); 00086 } 00087 00093 void Jaguar::PIDWrite(float output) 00094 { 00095 Set(output); 00096 } 00097
Generated on Thu Jan 12 2012 22:35:20 for WPILibC++ by
1.7.1