blob: c5375f4680edf6421793ccadf0fe03d023956fa5 [file] [log] [blame]
James Kuszmaul4f3ad3c2019-12-01 16:35:21 -08001/*----------------------------------------------------------------------------*/
2/* Copyright (c) 2019 FIRST. 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 "frc/PWMSparkMax.h"
9
James Kuszmaul4b81d302019-12-14 20:53:14 -080010#include <hal/FRCUsageReporting.h>
James Kuszmaul4f3ad3c2019-12-01 16:35:21 -080011
12#include "frc/smartdashboard/SendableRegistry.h"
13
14using namespace frc;
15
16PWMSparkMax::PWMSparkMax(int channel) : PWMSpeedController(channel) {
James Kuszmaul4b81d302019-12-14 20:53:14 -080017 SetBounds(2.003, 1.55, 1.50, 1.46, 0.999);
James Kuszmaul4f3ad3c2019-12-01 16:35:21 -080018 SetPeriodMultiplier(kPeriodMultiplier_1X);
19 SetSpeed(0.0);
20 SetZeroLatch();
21
James Kuszmaul4b81d302019-12-14 20:53:14 -080022 HAL_Report(HALUsageReporting::kResourceType_RevSparkMaxPWM, GetChannel() + 1);
James Kuszmaul4f3ad3c2019-12-01 16:35:21 -080023 SendableRegistry::GetInstance().SetName(this, "PWMSparkMax", GetChannel());
24}