variable declaration using SD using config.ini

Hi I am wanting to use a SD card and set variable pins from it. I have this working or thought I did

as an example I would

in the setup read values into variables and then want to use the Lcd library I would

LiquidCrystal lcd(rs.toInt(), en.toInt(), d4.toInt(), d5.toInt(), d6.toInt(), d7.toInt());

but when I try to use in the loop section I get a

'LCD' not declared in this scope.

Is this possible or do I have to declare in the top and have the pins hard coded?

thanks
Jasemilly

(deleted)

You will need to declare a pointer to the LiquidCrystal instance, initialized to null.

LiquidCrystal *pLCD = NULL;

In setup(), after you get the values, you will add:

  pLCD = new LiquidCrystal(rs.toInt(), en.toInt(), d4.toInt(), d5.toInt(), d6.toInt(), d7.toInt());

Then, everywhere where you currently have “LCD.”, you will have to use “pLCD->”

Thank you PaulS that worked