Expose current state

This commit is contained in:
Jonathan Senecal
2022-04-04 13:24:32 -04:00
parent 6c9f1230c7
commit d100fb166b
2 changed files with 2 additions and 0 deletions

View File

@@ -63,6 +63,7 @@ void DMX512Output::set_channel(uint16_t channel) {
}
void DMX512Output::write_state(float state) {
this->state = state;
uint16_t value = state * 0xffff;
if(this->universe_)
this->universe_->write_channel(this->channel_, (value >> 8));

View File

@@ -75,6 +75,7 @@ public:
void set_universe(DMX512 *universe) { this->universe_ = universe; }
void set_channel(uint16_t channel);
void write_state(float state) override;
float state;
protected:
uint16_t channel_{0};