SensESP 2.7.2
Universal Signal K sensor toolkit ESP32
Loading...
Searching...
No Matches
pwm_output.h
Go to the documentation of this file.
1#ifndef _pwm_output_H_
2#define _pwm_output_H_
3
4#include <map>
5
6#include "valueconsumer.h"
7
8namespace sensesp {
9
32class PWMOutput : public ValueConsumer<float> {
33 public:
44 PWMOutput(int pin = -1, int pwm_channel = -1);
45
51 virtual void set_input(float new_value, uint8_t pwm_channel = 0) override;
52
62 static int assign_channel(int pin, int pwm_channel = -1);
63
70 static void set_pwm(int pwm_channel, float value);
71
72 protected:
73 static std::map<uint8_t, int8_t> channel_to_pin_;
75};
76
77} // namespace sensesp
78
79#endif
Construct a new transform based on a single function.
Provides a cross platform mechanism for generating Pulse Width Modulation signals over one or more GP...
Definition pwm_output.h:32
static std::map< uint8_t, int8_t > channel_to_pin_
Definition pwm_output.h:73
virtual void set_input(float new_value, uint8_t pwm_channel=0) override
static int assign_channel(int pin, int pwm_channel=-1)
static void set_pwm(int pwm_channel, float value)
uint8_t default_channel_
Definition pwm_output.h:74
A base class for piece of code (like a transform) that accepts data for input. ValueConsumers can acc...