|
| | DigitalOut (uint8_t pin, Engine &engine=Engine::primary()) |
| | Constructor with default mode DIRECT.
|
| |
| | DigitalOut (uint8_t pin, uint8_t mode, Engine &engine=Engine::primary()) |
| | Constructor.
|
| |
| virtual void | mode (uint8_t mode) |
| | Changes the mode of the component.
|
| |
|
void | write (bool value) |
| | Directly writes value to the pin (bypasses mode and engine).
|
| |
|
void | write (float value) |
| | Directly writes value in [0, 1] to the pin (bypasses mode and engine).
|
| |
|
void | rawWrite (int value) |
| | Directly writes HIGH or LOW value to the pin (bypasses mode and engine).
|
| |
| virtual bool | isOn () |
| | Returns true iff the input is "on".
|
| |
| virtual bool | putOn (bool value) |
| | Pushes value into the unit.
|
| |
|
virtual bool | rose () |
| | Returns true if the value rose.
|
| |
|
virtual bool | fell () |
| | Returns true if the value fell.
|
| |
|
virtual bool | changed () |
| | Returns true if the value changed.
|
| |
|
virtual bool | toggle () |
| | Switches between on and off.
|
| |
|
virtual int8_t | changeState () |
| | Difference between current and previous value of the unit.
|
| |
|
virtual void | onRise (EventCallback callback) |
| | Registers event callback on rise event.
|
| |
|
virtual void | onFall (EventCallback callback) |
| | Registers event callback on fall event.
|
| |
|
virtual void | onChange (EventCallback callback) |
| | Registers event callback on change event.
|
| |
|
virtual bool | isOff () |
| | Returns true iff the input is "off".
|
| |
|
virtual int | getInt () |
| | Returns value as integer (0 or 1).
|
| |
| virtual float | get () |
| | Returns value as float (either 0.0 or 1.0).
|
| |
|
virtual bool | on () |
| | Sets output to "on" (ie. true, 1).
|
| |
|
virtual bool | off () |
| | Sets output to "off" (ie. false, 0).
|
| |
| virtual float | put (float value) |
| | Pushes value into the unit.
|
| |
| virtual float | mapTo (float toLow, float toHigh) |
| | Maps value to new range.
|
| |
|
| operator bool () |
| | Operator that allows usage in conditional expressions.
|
| |
|
| operator float () |
| |
|
virtual void | clearEvents () |
| |
|
float | seconds () const |
| | Returns engine time in seconds.
|
| |
|
uint32_t | milliSeconds () const |
| | Returns engine time in milliseconds.
|
| |
|
uint64_t | microSeconds () const |
| | Returns engine time in microseconds.
|
| |
|
unsigned long | nSteps () const |
| | Returns number of engine steps.
|
| |
|
float | sampleRate () const |
| | Returns engine sample rate.
|
| |
|
float | samplePeriod () const |
| | Returns enginesample period.
|
| |
|
uint8_t | pin () const |
| | Returns the pin this component is attached to.
|
| |
|
uint8_t | mode () const |
| | Returns the mode of the component.
|
| |
A generic class representing a simple digital output.