I am trying to make a child class from the Adafruit_SSD1306, with some added functionality. The only thing I have written is the constructor, but I am getting an error where all of my parameters in the constructor are being passed to the Adafruit_SSD1306 I2C constructor by reference.
My entire class is as follows:
class LDisplay : public Adafruit_SSD1306{
public:
LDisplay(uint8_t w, uint8_t h, TwoWire *twi = &Wire, int8_t rst_pin = -1,
uint32_t clkDuring = 400000UL, uint32_t clkAfter = 100000UL)
: Adafruit_SSD1306(w, h, *twi, rst_pin, clkDuring, clkAfter){
}
};
My constructor call in my .ino is:
LDisplay d(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET, 1000000UL, 100000UL);
and the error I am getting is:
error: no matching function for call to 'Adafruit_SSD1306::Adafruit_SSD1306(uint8_t&, uint8_t&, TwoWire&, int8_t&, uint32_t&, uint32_t&)'
: Adafruit_SSD1306(w, h, *twi, rst_pin, clkDuring, clkAfter){
In case it matters, I am using an ESP32 with the default I2c pins.
Any help you can provide would be greatly appreciated. Thanks so much!