no instance of constructor "TEWRE::TEWRE" matches the argument list — argument types are: (int, int, int, RotaryEncoder, LCD_I2C)

  arduino, c++

Couldnt get over this error : "no instance of constructor ". I am using Visual Studio with platformio. unfortunately couldnt find any solution to this error. Any idea or help would be lovely. Thanks

no instance of constructor "TEWRE::TEWRE" matches the argument list — argument types are: (int, int, int, RotaryEncoder, LCD_I2C)

TEWRE.h

class TEWRE
{
public:
    TEWRE();
    TEWRE(uint8_t _row, uint8_t _col, uint8_t _maxTextSize, RotaryEncoder *_RE, LCD_I2C *_lcd);
    void begin();

    char *getText();

private:
    RotaryEncoder *encoder;
    LCD_I2C *lcd;
    void setArrowPos(byte pos);
    int findRotPOS();
    void buttonClick();
    void buttonDoubleClick();
    void buttonLongClick();
    void showCharFromList(int charPos, int curpos);
    //char *list;   // list if letters
    char list[37] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; 
    int listSize = sizeof(list);
    int maxTextSize = DEFAULT_maxTextSize;  // 
    char *Text;
    byte curOffset  = 0;  // This is basically the starting position on LCD
    byte curLine    = 0;  // This is basically the starting line on LCD. max limit = maxLCDlimit - 1 
    byte Index      = 0;  // file name cursor position

};
TEWRE.cpp
 

TEWRE::TEWRE()  // default constructor
{
    // list         = 0;
    curLine     = 0;
    curOffset   = 0;
    maxTextSize = 0;
    
    encoder = NULL;
    lcd     = NULL;
}

TEWRE::TEWRE(uint8_t _row, uint8_t _col,uint8_t _maxTextSize,RotaryEncoder *_RE,LCD_I2C *_lcd)
{
    //list          = _list;
    curLine     = _row;
    curOffset   = _col;
    maxTextSize = _maxTextSize;
    
    encoder = _RE;
    lcd     = _lcd;

}


main.c
    
LCD_I2C lcd(0x27);
RotaryEncoder Encoder(7,8,9);

TEWRE fn(0,10,6,Encoder,lcd);
 //   ^---  error occures here

void setup() {
  // put your setup code here, to run once:
  lcd.begin(20,4);
  lcd.display();
  lcd.clear();
  lcd.setCursor(0,0); lcd.print("File Name: ");
}

void loop() {
  // put your main code here, to run repeatedly:
}


enter code here

Source: Windows Questions C++

LEAVE A COMMENT