Stream/serial output. Number of digits of precision is configurable. More...
#include <StreamOut.h>


Public Member Functions | |
| StreamOut (Engine &engine=Engine::primary()) | |
| Default constructor. | |
| StreamOut (Stream &stream, Engine &engine=Engine::primary()) | |
| Constructor. | |
| virtual float | mapTo (float toLow, float toHigh) |
| Maps value to new range. | |
| virtual float | put (float value) |
| Pushes value into the unit. | |
| virtual void | precision (uint8_t digits) |
| Sets precision of the output. | |
| virtual float | get () |
| Returns value in [0, 1]. | |
| 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. | |
| operator float () | |
| Object can be used directly to access its value. | |
| operator bool () | |
| Operator that allows usage in conditional expressions. | |
Protected Member Functions | |
| 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. | |
Protected Attributes | |
| uint8_t | _digits |
| Stream * | _stream |
| float | _value |
Stream/serial output. Number of digits of precision is configurable.
| pq::StreamOut::StreamOut | ( | Engine & | engine = Engine::primary() | ) |
Default constructor.
| engine | the engine running this unit |
| pq::StreamOut::StreamOut | ( | Stream & | stream, |
| Engine & | engine = Engine::primary() |
||
| ) |
Constructor.
| stream | a reference to a Stream object |
| engine | the engine running this unit |
|
inlineprotectedvirtualinherited |
Returns true iff an event of a certain type has been triggered.
Reimplemented in pq::AbstractWave, pq::Alarm, pq::Metronome, pq::PeakDetector, pq::DigitalSource, pq::Ramp, pq::StreamIn, and pq::TimeSliceField< COUNT >.
|
inlinevirtualinherited |
|
inlinevirtual |
Maps value to new range.
Reimplemented from pq::AnalogSource.
|
virtual |
Sets precision of the output.
| digits | the number of digits to show after decimal point |
|
virtual |
Pushes value into the unit.
| value | the value sent to the unit |
Reimplemented from pq::Chainable.