fixed and auto-formatted the rpm_counter example
//#define SERIAL_DEBUG_DISABLED
-#include "sensesp_app.h"
#include "devices/digital_input.h"
+#include "sensesp_app.h"
#include "transforms/frequency.h"
#include "wiring_helpers.h"
@@ -28,33 +28,31 @@ ReactESP app([] () {
// a frequency. The sample multiplier converts the 97 tooth
// tach output into Hz, SK native units.
-
// Three ways to wire up devices and transformations:
// 1. Connect by specifying <Observer,Transform> (aka <Device,Transform>):
/*
sensesp_app->connect_1to1<DigitalInputCounter, Frequency>(
new DigitalInputCounter(D5, INPUT_PULLUP, RISING, 500),
- new Frequency("propulsion.left.revolutions", 1./97., "/sensors/engine_rpm")
+ new Frequency("propulsion.left.revolutions", 1./97.,
+ "/sensors/engine_rpm")
);
*/
-
-
// 2. Connect by specifying data type of Producer's output/Consumer's input
/*
sensesp_app->connect<int>(
new DigitalInputCounter(D5, INPUT_PULLUP, RISING, 500),
- new Frequency("propulsion.left.revolutions", 1./97., "/sensors/engine_rpm")
+ new Frequency("propulsion.left.revolutions", 1./97.,
+ "/sensors/engine_rpm")
);
*/
-
// 3. Connect the producer directly to the consumer
-new DigitalInputCounter(D5, INPUT_PULLUP, RISING, 500)
- -> connectTo(new Frequency("propulsion.left.revolutions", 1./97., "/sensors/engine_rpm"));
-
+ (new DigitalInputCounter(D5, INPUT_PULLUP, RISING, 500))
+ ->connectTo(new Frequency("propulsion.left.revolutions", 1. / 97.,
+ "/sensors/engine_rpm"));
sensesp_app->enable();
});
