minimum Helper

template<size_t MaxDeps = 8, typename Source1, typename Source2>
auto RxESP32::Helpers::Analysis::minimum(Source1 &source1, Source2 &source2, const typename Computed<decltype(source1.get()), 2, MaxDeps>::Options &options = {})

Get minimum of two signals.

Creates a Computed that returns the minimum value between two sources.

Since

v0.1.0

Signal<int> a(10);
Signal<int> b(20);
auto min_ab = minimum(a, b);
Serial.println(min_ab.get()); // 10
a.set(30);
Serial.println(min_ab.get()); // 20

Warning

  • Requires both sources to have the same type.

  • Only accepts arithmetic types (integral and floating-point).

Template Parameters:
size_t MaxDeps = 8

Maximum number of dependents for the computed signal.

Parameters:
Source1 &source1

First source signal.

Source2 &source2

Second source signal.

const typename Computed<decltype(source1.get()), 2, MaxDeps>::Options &options = {}

Optional Computed configuration.

Returns:

Computed with minimum values.

See Also