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:118
void InitTable(std::shared_ptr< ITable > subTable)
Initializes a table for this sendable object.
Definition: DigitalOutput.cpp:254
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:250
void EnablePWM(double initialDutyCycle)
Enable a PWM Output on this line.
Definition: DigitalOutput.cpp:158
void UpdateTable()
Update the table for this sendable object with the latest values.
Definition: DigitalOutput.cpp:236
DigitalOutput(int channel)
Create an instance of a digital output.
Definition: DigitalOutput.cpp:26
AnalogTriggerType GetAnalogTriggerTypeForRouting() const override
Definition: DigitalOutput.cpp:226
void StopLiveWindowMode()
Stop having this sendable object automatically respond to value changes.
Definition: DigitalOutput.cpp:244
void Set(bool value)
Set the value of a digital output.
Definition: DigitalOutput.cpp:70
bool IsAnalogTrigger() const override
Is source an AnalogTrigger.
Definition: DigitalOutput.cpp:221
int GetChannel() const override
Definition: DigitalOutput.cpp:95
void SetPWMRate(double rate)
Change the PWM frequency of the PWM output on a Digital Output line.
Definition: DigitalOutput.cpp:137
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:230
void DisablePWM()
Change this line from a PWM output back to a static Digital Output line.
Definition: DigitalOutput.cpp:181
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:259
void Pulse(double length)
Output a single pulse on the digital output line.
Definition: DigitalOutput.cpp:105
virtual ~DigitalOutput()
Free the resources associated with a digital output.
Definition: DigitalOutput.cpp:54
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:83
void UpdateDutyCycle(double dutyCycle)
Change the duty-cycle that is being generated on the line.
Definition: DigitalOutput.cpp:205
void StartLiveWindowMode()
Start having this sendable object automatically respond to value changes reflect the value on the tab...
Definition: DigitalOutput.cpp:238
HAL_Handle GetPortHandleForRouting() const override
Definition: DigitalOutput.cpp:216