Write-only monitor unit for textual output. More...
#include <Monitor.h>


Public Member Functions | |
| Monitor (unsigned long baudRate, Engine &engine=Engine::primary()) | |
| Construct a Monitor using the default Serial device. | |
| Monitor (SerialType &device, unsigned long baudRate, Engine &engine=Engine::primary()) | |
| Construct a Monitor using a specific serial device. | |
| Monitor (Print &device, Engine &engine=Engine::primary()) | |
| Construct a Monitor using a generic Print backend. | |
| Print & | device () const |
| Get the current Print backend. | |
| void | precision (uint8_t digits) |
| Set the number of digits to print after the decimal point. | |
| uint8_t | precision () const |
| Get the number of digits to print after the decimal point by default. | |
| float | put (float value) override |
| Pushes value into the unit. | |
| float | get () override |
| Returns value (last value that was put()). | |
| virtual size_t | write (uint8_t b) override |
| Core Print override. | |
| size_t | print (double v) |
| size_t | println (double v) |
| 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. | |
| virtual float | mapTo (float toLow, float toHigh) |
| Maps value to new range. | |
| operator bool () | |
| Operator that allows usage in conditional expressions. | |
Protected Member Functions | |
| void | begin () override |
| Ensure the underlying device is started (idempotent). | |
| 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 | |
| Print * | _device = nullptr |
| bool | _isSerial: 1 |
| bool | _begun: 1 |
| uint8_t | _digits: 6 |
| unsigned long | _baudRate = 0 |
| float | _value |
Write-only monitor unit for textual output.
Monitor is a Plaquette Unit and a Print proxy. It is intended for human-readable output (debugging, status messages) and deliberately does not expose Stream read functionality to avoid blocking behavior.
The backend can be any Print-compatible object (Serial, file, etc.). When bound to a serial device, Monitor can auto-start it at a given baud rate.
|
explicit |
Construct a Monitor using a generic Print backend.
No auto-start is performed.
|
overrideprotectedvirtual |
Ensure the underlying device is started (idempotent).
For non-serial backends, this is a no-op.
Reimplemented from pq::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 >.
|
inlineoverridevirtual |
Returns value (last value that was put()).
Reimplemented from pq::Flowable.
|
inlinevirtualinherited |
Maps value to new range.
This function guarantees that the value is within [toLow, toHigh]. If the unit's values are unbounded, returns get() constrained to [toLow, toHigh].
Reimplemented in pq::Normalizer, pq::DigitalUnit, pq::AnalogSource, pq::AnalogIn, pq::Ramp, pq::StreamIn, and pq::StreamOut.
|
overridevirtual |
Pushes value into the unit.
| value | the value sent to the unit |
Reimplemented from pq::Flowable.
|
overridevirtual |
Core Print override.
All print()/println() calls funnel through this method.