68 explicit PWM(
int channel,
bool registerSendable =
true);
190 double deadbandMin,
double min);
231 hal::Handle<HAL_DigitalHandle> m_handle;
A class for driving addressable LEDs, such as WS2812s and NeoPixels.
Definition: AddressableLED.h:24
Class implements the PWM generation in the FPGA.
Definition: PWM.h:34
virtual void SetRaw(uint16_t value)
Set the PWM value directly to the hardware.
PeriodMultiplier
Represents the amount to multiply the minimum servo-pulse pwm period by.
Definition: PWM.h:41
@ kPeriodMultiplier_1X
Don't skip pulses.
Definition: PWM.h:45
@ kPeriodMultiplier_4X
Skip three out of four pulses.
Definition: PWM.h:53
@ kPeriodMultiplier_2X
Skip every other pulse.
Definition: PWM.h:49
void SetRawBounds(int max, int deadbandMax, int center, int deadbandMin, int min)
Set the bounds on the PWM values.
virtual void SetPosition(double pos)
Set the PWM value based on a position.
void EnableDeadbandElimination(bool eliminateDeadband)
Optionally eliminate the deadband from a motor controller.
virtual void SetDisabled()
Temporarily disables the PWM output.
virtual void SetSpeed(double speed)
Set the PWM value based on a speed.
virtual uint16_t GetRaw() const
Get the PWM value directly from the hardware.
PWM(int channel, bool registerSendable=true)
Allocate a PWM given a channel number.
void InitSendable(wpi::SendableBuilder &builder) override
Initializes this Sendable object.
void GetRawBounds(int32_t *max, int32_t *deadbandMax, int32_t *center, int32_t *deadbandMin, int32_t *min)
Get the bounds on the PWM values.
virtual double GetPosition() const
Get the PWM value in terms of a position.
void SetBounds(double max, double deadbandMax, double center, double deadbandMin, double min)
Set the bounds on the PWM pulse widths.
~PWM() override
Free the PWM channel.
PWM & operator=(PWM &&)=default
void SetPeriodMultiplier(PeriodMultiplier mult)
Slow down the PWM signal for old devices.
virtual double GetSpeed() const
Get the PWM value in terms of speed.
Definition: SendableBuilder.h:18
A helper class for use with objects that add themselves to SendableRegistry.
Definition: SendableHelper.h:19
Interface for Sendable objects.
Definition: Sendable.h:16
constexpr common_t< T1, T2 > max(const T1 x, const T2 y) noexcept
Compile-time pairwise maximum function.
Definition: max.hpp:35
constexpr common_t< T1, T2 > min(const T1 x, const T2 y) noexcept
Compile-time pairwise minimum function.
Definition: min.hpp:35
::uint16_t uint16_t
Definition: Meta.h:54
::int32_t int32_t
Definition: Meta.h:57
Definition: AprilTagFieldLayout.h:22