Brian Silverman | f7f267a | 2017-02-04 16:16:08 -0800 | [diff] [blame^] | 1 | /*----------------------------------------------------------------------------*/ |
| 2 | /* Copyright (c) FIRST 2008-2017. All Rights Reserved. */ |
| 3 | /* Open Source Software - may be modified and shared by FRC teams. The code */ |
| 4 | /* must be accompanied by the FIRST BSD license file in the root directory of */ |
| 5 | /* the project. */ |
| 6 | /*----------------------------------------------------------------------------*/ |
| 7 | |
| 8 | #include "Jaguar.h" |
| 9 | |
| 10 | #include "HAL/HAL.h" |
| 11 | #include "LiveWindow/LiveWindow.h" |
| 12 | |
| 13 | using namespace frc; |
| 14 | |
| 15 | /** |
| 16 | * Constructor for a Jaguar connected via PWM. |
| 17 | * |
| 18 | * @param channel The PWM channel that the Jaguar is attached to. 0-9 are |
| 19 | * on-board, 10-19 are on the MXP port |
| 20 | */ |
| 21 | Jaguar::Jaguar(int channel) : PWMSpeedController(channel) { |
| 22 | /** |
| 23 | * Input profile defined by Luminary Micro. |
| 24 | * |
| 25 | * Full reverse ranges from 0.671325ms to 0.6972211ms |
| 26 | * Proportional reverse ranges from 0.6972211ms to 1.4482078ms |
| 27 | * Neutral ranges from 1.4482078ms to 1.5517922ms |
| 28 | * Proportional forward ranges from 1.5517922ms to 2.3027789ms |
| 29 | * Full forward ranges from 2.3027789ms to 2.328675ms |
| 30 | */ |
| 31 | SetBounds(2.31, 1.55, 1.507, 1.454, .697); |
| 32 | SetPeriodMultiplier(kPeriodMultiplier_1X); |
| 33 | SetSpeed(0.0); |
| 34 | SetZeroLatch(); |
| 35 | |
| 36 | HAL_Report(HALUsageReporting::kResourceType_Jaguar, GetChannel()); |
| 37 | LiveWindow::GetInstance()->AddActuator("Jaguar", GetChannel(), this); |
| 38 | } |