Enable reverse display of the Max7219 digit (#1234)
* add reverse option * Update max7219digit.cpp adding space for formatting * Update esphome/components/max7219digit/display.py Copy past error... Co-authored-by: Otto Winter <otto@otto-winter.com> Co-authored-by: Otto Winter <otto@otto-winter.com>
This commit is contained in:
1 parent
0e59243b83
commit
0ccfdd4711
3 files changed
+10
-1
No files matched your search
@@ -108,7 +108,11 @@ void MAX7219Component::display() {
|
||||
// Send the data to the chip
|
||||
for (uint8_t i = 0; i < this->num_chips_; i++) {
|
||||
for (uint8_t j = 0; j < 8; j++) {
|
||||
pixels[j] = this->max_displaybuffer_[i * 8 + j];
|
||||
if (this->reverse_) {
|
||||
pixels[j] = this->max_displaybuffer_[(this->num_chips_ - i - 1) * 8 + j];
|
||||
} else {
|
||||
pixels[j] = this->max_displaybuffer_[i * 8 + j];
|
||||
}
|
||||
}
|
||||
this->send64pixels(i, pixels);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user