A generic class representing a simple digital (true/false)unit.
More...
#include <PqCore.h>
|
| virtual bool | isOn () |
| | Returns true iff the input is "on".
|
| |
|
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 bool | putOn (bool 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.
|
| |
|
|
static bool | analogToDigital (float f) |
| | Converts analog (float) value to digital (bool) value.
|
| |
|
static float | digitalToAnalog (bool b) |
| | Converts digital (bool) value to analog (float) value.
|
| |
|
|
| DigitalUnit (Engine &engine) |
| | Constructor.
|
| |
| virtual void | begin () |
| |
|
virtual void | step () |
| |
| virtual bool | eventTriggered (EventType eventType) |
| | Returns true iff an event of a certain type has been triggered.
|
| |
|
virtual void | onEvent (EventCallback callback, EventType eventType) |
| | Registers event callback.
|
| |
|
Engine * | engine () const |
| | Returns the engine that owns this unit.
|
| |
A generic class representing a simple digital (true/false)unit.
◆ begin()
| virtual void pq::Unit::begin |
( |
| ) |
|
|
inlineprotectedvirtualinherited |
◆ eventTriggered()
| virtual bool pq::Unit::eventTriggered |
( |
EventType |
eventType | ) |
|
|
inlineprotectedvirtualinherited |
◆ get()
| virtual float pq::DigitalUnit::get |
( |
| ) |
|
|
inlinevirtual |
Returns value as float (either 0.0 or 1.0).
Reimplemented from pq::Flowable.
◆ isOn()
| virtual bool pq::DigitalUnit::isOn |
( |
| ) |
|
|
inlinevirtual |
◆ mapTo()
| virtual float pq::DigitalUnit::mapTo |
( |
float |
toLow, |
|
|
float |
toHigh |
|
) |
| |
|
inlinevirtual |
◆ put()
| virtual float pq::DigitalUnit::put |
( |
float |
value | ) |
|
|
inlinevirtual |
Pushes value into the unit.
- Parameters
-
| value | the value sent to the unit |
- Returns
- the new value of the unit
Reimplemented from pq::Flowable.
Reimplemented in pq::PeakDetector.
◆ putOn()
| virtual bool pq::DigitalUnit::putOn |
( |
bool |
value | ) |
|
|
inlinevirtual |
Pushes value into the unit.
- Parameters
-
| value | the value sent to the unit |
- Returns
- the new value of the unit
Reimplemented in pq::DigitalSource.
The documentation for this class was generated from the following file:
- /home/tats/Documents/workspace/Plaquette/src/PqCore.h