For a project with a 8x32 RGB Matrix i need to build a custom component to do the text scrolling as a first step.
After reading and trying i couldn’t find a solution.
I tink i have to pass the display, font, color and text_sensor to my custom component. Which doesn’t work at all. The yaml works fine, but not my selfmade code.
So here is the relevant part of my custom component:
class HAtrixComponent : public PollingComponent {
public:
display::DisplayBuffer cDisplay;
TextSensor cText;
void *cFont;
Color cColor;
HAtrixComponent(display::DisplayBuffer *it,TextSensor *text, Color *color, void *pfont) : PollingComponent(250)
{
cDisplay = it;
cText = text;
cColor = color;
cFont= pfont;
}
}
and here are some of the errors:
In file included from src/main.cpp:49:0:
src/HAtrixcomponent.h:9:28: error: cannot declare field 'HAtrixComponent::cDisplay' to be of abstract type 'esphome::display::DisplayBuffer'
display::DisplayBuffer cDisplay;
In file included from src/main.cpp:49:0:
src/HAtrixcomponent.h: In constructor 'HAtrixComponent::HAtrixComponent(esphome::display::DisplayBuffer*, esphome::text_sensor::TextSensor*, esphome::Color*, void*)':
src/HAtrixcomponent.h:16:15: error: no match for 'operator=' (operand types are 'esphome::display::DisplayBuffer' and 'esphome::display::DisplayBuffer*')
cDisplay = it;
In file included from src/main.cpp:49:0:
src/HAtrixcomponent.h:17:12: error: no match for 'operator=' (operand types are 'esphome::text_sensor::TextSensor' and 'esphome::text_sensor::TextSensor*')
cText = text;
Any hints for me? My goal is to create something like this this or this only in esphome.