Skip to content

Examples Aggregates

Luis Llamas edited this page Apr 25, 2019 · 4 revisions

Aggregates Examples

Count/Sum/Min/Max/Average/RMS

#include "ReactiveArduinoLib.h"

auto observableInt = Reactive::FromProperty<int>();

void setup()
{
	Serial.begin(9600);
	while (!Serial) delay(1);

	observableInt
		>> Reactive::Max<int>()  //same for Sum, Min, Max, Average or RMS
		>> Reactive::ToSerial<int>();
}

void loop()
{
	delay(1000);
	observableInt = 1;
	delay(1000);
	observableInt = 2;
	delay(1000);
	observableInt = 2;
	delay(1000);
	observableInt = 3;
}
Clone this wiki locally