27 void setup()
override;
57 void play(Ts...
x)
override {
58 auto level_percent = this->level_percent_.value(
x...);
59 this->parent_->set_level_percent(level_percent);
67 void play(Ts...
x)
override {
68 auto level = this->
level_.value(
x...);
69 this->parent_->set_level(level);
77 void play(Ts...
x)
override {
79 this->parent_->set_brightness(brightness);
85 void play(Ts...
x)
override { this->parent_->turn_on(); }
90 void play(Ts...
x)
override { this->parent_->turn_off(); }
void set_brightness(TM1651Brightness new_brightness)
void dump_config() override
InternalGPIOPin * clk_pin_
void set_level_percent(uint8_t new_level)
uint8_t calculate_level_(uint8_t new_level)
void set_dio_pin(InternalGPIOPin *pin)
InternalGPIOPin * dio_pin_
TEMPLATABLE_VALUE(uint8_t, brightness) void play(Ts... x) override
void set_clk_pin(InternalGPIOPin *pin)
void set_brightness(uint8_t new_brightness)
uint8_t calculate_brightness_(uint8_t new_brightness)
Implementation of SPI Controller mode.
TEMPLATABLE_VALUE(uint8_t, level_percent) void play(Ts... x) override
void play(Ts... x) override
TEMPLATABLE_VALUE(uint8_t, level) void play(Ts... x) override
std::unique_ptr< TM1651 > battery_display_
Helper class to easily give an object a parent of type T.
void set_level(uint8_t new_level)
void play(Ts... x) override