blob: 54ef45915f303e92460902e41fc14502f6805879 [file] [log] [blame]
brians343bc112013-02-10 01:53:46 +00001#include "aos/crio/Talon.h"
2#include "WPILib/DigitalModule.h"
3
4Talon::Talon(UINT32 channel) : SafePWM(channel) {
5 // 255 = 2.5ms, 0 = 0.5ms (or something close to that)
6 // these numbers were determined empirically with real hardware by Brian
7 // on 11/23/12
8 // got 211->210 as first transition that made a speed difference and
9 // 53->54 on the other side
10 // going 2 to each side to make sure we get the full range
11 SetBounds(213, 137, 132, 127, 50);
12 // 1X = every 5.05ms, 2X and 4x are multiples of that
13 SetPeriodMultiplier(kPeriodMultiplier_1X);
14 SetRaw(m_centerPwm);
15}
16
17void Talon::Set(float speed, UINT8 /*syncGroup*/) { SetSpeed(speed); }
18float Talon::Get() { return GetSpeed(); }
19void Talon::Disable() { SetRaw(kPwmDisabled); }
20
21void Talon::PIDWrite(float output) { Set(output); }