Parker Schuh | d3b7a887 | 2018-02-19 16:42:27 -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 "frc971/wpilib/ahal/Servo.h" |
| 9 | |
| 10 | using namespace frc; |
| 11 | |
| 12 | constexpr double Servo::kDefaultMaxServoPWM; |
| 13 | constexpr double Servo::kDefaultMinServoPWM; |
| 14 | |
| 15 | /** |
| 16 | * @param channel The PWM channel to which the servo is attached. 0-9 are |
| 17 | * on-board, 10-19 are on the MXP port |
| 18 | */ |
| 19 | Servo::Servo(int channel) : PWM(channel) { |
| 20 | // Set minimum and maximum PWM values supported by the servo |
| 21 | SetBounds(kDefaultMaxServoPWM, 0.0, 0.0, 0.0, kDefaultMinServoPWM); |
| 22 | |
| 23 | // Assign defaults for period multiplier for the servo PWM control signal |
| 24 | SetPeriodMultiplier(kPeriodMultiplier_4X); |
| 25 | } |
| 26 | |
| 27 | Servo::~Servo() {} |