13 #include "DigitalSource.h"
14 #include "HAL/Types.h"
15 #include "LiveWindow/LiveWindowSendable.h"
16 #include "tables/ITableListener.h"
35 void Pulse(
double length);
48 std::shared_ptr<nt::Value> value,
bool isNew)
override;
53 void InitTable(std::shared_ptr<ITable> subTable);
54 std::shared_ptr<ITable>
GetTable()
const;
58 HAL_DigitalHandle m_handle;
59 HAL_DigitalPWMHandle m_pwmGenerator;
61 std::shared_ptr<ITable> m_table;
A table whose values can be read and written to.
Definition: ITable.h:22
bool IsPulsing() const
Determine if the pulse is still going.
Definition: DigitalOutput.cpp:120
void InitTable(std::shared_ptr< ITable > subTable)
Initializes a table for this sendable object.
Definition: DigitalOutput.cpp:256
Live Window Sendable is a special type of object sendable to the live window.
Definition: LiveWindowSendable.h:17
std::string GetSmartDashboardType() const
Definition: DigitalOutput.cpp:252
void EnablePWM(double initialDutyCycle)
Enable a PWM Output on this line.
Definition: DigitalOutput.cpp:160
void UpdateTable()
Update the table for this sendable object with the latest values.
Definition: DigitalOutput.cpp:238
DigitalOutput(int channel)
Create an instance of a digital output.
Definition: DigitalOutput.cpp:28
AnalogTriggerType GetAnalogTriggerTypeForRouting() const override
Definition: DigitalOutput.cpp:228
void StopLiveWindowMode()
Stop having this sendable object automatically respond to value changes.
Definition: DigitalOutput.cpp:246
void Set(bool value)
Set the value of a digital output.
Definition: DigitalOutput.cpp:72
bool IsAnalogTrigger() const override
Is source an AnalogTrigger.
Definition: DigitalOutput.cpp:223
int GetChannel() const override
Definition: DigitalOutput.cpp:97
void SetPWMRate(double rate)
Change the PWM frequency of the PWM output on a Digital Output line.
Definition: DigitalOutput.cpp:139
void ValueChanged(ITable *source, llvm::StringRef key, std::shared_ptr< nt::Value > value, bool isNew) override
Called when a key-value pair is changed in a ITable.
Definition: DigitalOutput.cpp:232
void DisablePWM()
Change this line from a PWM output back to a static Digital Output line.
Definition: DigitalOutput.cpp:183
DigitalSource Interface.
Definition: DigitalSource.h:25
A listener that listens to changes in values in a ITable.
Definition: ITableListener.h:18
std::shared_ptr< ITable > GetTable() const
Definition: DigitalOutput.cpp:261
void Pulse(double length)
Output a single pulse on the digital output line.
Definition: DigitalOutput.cpp:107
virtual ~DigitalOutput()
Free the resources associated with a digital output.
Definition: DigitalOutput.cpp:56
Class to write to digital outputs.
Definition: DigitalOutput.h:26
bool Get() const
Gets the value being output from the Digital Output.
Definition: DigitalOutput.cpp:85
void UpdateDutyCycle(double dutyCycle)
Change the duty-cycle that is being generated on the line.
Definition: DigitalOutput.cpp:207
void StartLiveWindowMode()
Start having this sendable object automatically respond to value changes reflect the value on the tab...
Definition: DigitalOutput.cpp:240
HAL_Handle GetPortHandleForRouting() const override
Definition: DigitalOutput.cpp:218