Treehopper C++ API
LedDriver.h
Go to the documentation of this file.
1 #pragma once
2 
6 #include <vector>
7 
8 namespace Treehopper {
9  namespace Libraries {
10  namespace Displays {
11 
12  using namespace std;
13  using namespace Treehopper::Libraries::IO;
14 
19  friend Led;
20  public:
27  LedDriver(int numLeds, bool hasGlobalBrightnessControl, bool hasIndividualBrightnessControl);
28 
32  vector<Led> leds;
33 
38 
43 
45  double brightness();
46 
52  void brightness(double value);
53 
54  protected:
55  double _brightness = 0.0;
56  private:
57  virtual void setGlobalBrightness(double _brightness) = 0;
58 
63  virtual void ledStateChanged(Led led) = 0;
64 
69  virtual void ledBrightnessChanged(Led led) = 0;
70 
75  void clear();
76  };
77  }
78  }
79 }
Represents any object that has a flushable interface.
Definition: Flushable.h:9
Represents a single LED that may or may not have _brightness control
Definition: Led.h:22
Definition: Ads1115Registers.h:10
Base class that all LED drivers inherit from.
Definition: LedDriver.h:18
vector< Led > leds
The collection of LEDs that belong to this driver.
Definition: LedDriver.h:32
const bool hasIndividualBrightnessControl
Gets or sets whether this controller&#39;s LEDs have individual _brightness control (through PWM or other...
Definition: LedDriver.h:42
const bool hasGlobalBrightnessControl
Gets or sets whether this controller supports global _brightness control.
Definition: LedDriver.h:37
#define LIBRARIES_API
Definition: Treehopper.Libraries.h:17
Definition: AdcPin.h:3