SensESP 3.0.1
Universal Signal K sensor toolkit ESP32
Loading...
Searching...
No Matches
frequency.h
Go to the documentation of this file.
1#ifndef SENSESP_TRANSFORMS_FREQUENCY_H_
2#define SENSESP_TRANSFORMS_FREQUENCY_H_
3
5#include "transform.h"
6
7namespace sensesp {
8
22class Frequency : public Transform<int, float> {
23 public:
24 Frequency(float multiplier = 1, const String& config_path = "");
25 virtual void set(const int& input) override;
26 virtual bool to_json(JsonObject& root) override;
27 virtual bool from_json(const JsonObject& config) override;
28
29 private:
30 float multiplier_;
31 int ticks_ = 0;
32 unsigned int last_update_ = 0;
33};
34
35const String ConfigSchema(const Frequency& obj);
36
37} // namespace sensesp
38
39#endif
Transforms its input into frequency (Hz: cycles per second)
Definition frequency.h:22
virtual bool from_json(const JsonObject &config) override
Definition frequency.cpp:26
virtual void set(const int &input) override
Definition frequency.cpp:14
virtual bool to_json(JsonObject &root) override
Definition frequency.cpp:21
Frequency(float multiplier=1, const String &config_path="")
Definition frequency.cpp:7
The main Transform class. A transform is identified primarily by the type of value that is produces (...
Definition transform.h:53
const String ConfigSchema(const SmartSwitchController &obj)