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:122
void InitTable(std::shared_ptr< ITable > subTable)
Initializes a table for this sendable object.
Definition: DigitalOutput.cpp:258
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:254
void EnablePWM(double initialDutyCycle)
Enable a PWM Output on this line.
Definition: DigitalOutput.cpp:162
void UpdateTable()
Update the table for this sendable object with the latest values.
Definition: DigitalOutput.cpp:240
DigitalOutput(int channel)
Create an instance of a digital output.
Definition: DigitalOutput.cpp:29
AnalogTriggerType GetAnalogTriggerTypeForRouting() const override
Definition: DigitalOutput.cpp:230
void StopLiveWindowMode()
Stop having this sendable object automatically respond to value changes.
Definition: DigitalOutput.cpp:248
void Set(bool value)
Set the value of a digital output.
Definition: DigitalOutput.cpp:74
bool IsAnalogTrigger() const override
Is source an AnalogTrigger.
Definition: DigitalOutput.cpp:225
int GetChannel() const override
Definition: DigitalOutput.cpp:99
void SetPWMRate(double rate)
Change the PWM frequency of the PWM output on a Digital Output line.
Definition: DigitalOutput.cpp:141
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:234
void DisablePWM()
Change this line from a PWM output back to a static Digital Output line.
Definition: DigitalOutput.cpp:185
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:263
void Pulse(double length)
Output a single pulse on the digital output line.
Definition: DigitalOutput.cpp:109
virtual ~DigitalOutput()
Free the resources associated with a digital output.
Definition: DigitalOutput.cpp:58
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:87
void UpdateDutyCycle(double dutyCycle)
Change the duty-cycle that is being generated on the line.
Definition: DigitalOutput.cpp:209
void StartLiveWindowMode()
Start having this sendable object automatically respond to value changes reflect the value on the tab...
Definition: DigitalOutput.cpp:242
HAL_Handle GetPortHandleForRouting() const override
Definition: DigitalOutput.cpp:220