maximum Helper

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

Get maximum of two signals.

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

Since

v0.1.0

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

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 maximum values.

See Also