Adafruit I2C Backpack

User avatar
Site Admin
Posts: 2188
Joined: Wed Nov 09, 2011 7:51 pm
Location: UK

Re: Adafruit I2C Backpack

Post by majenko » Tue Aug 30, 2016 7:22 pm

I would either inherit the expander as a parent class and (forgive the pun) expand on it, or pass an expander object (or a pointer to one) to the constructor of the LCD class.

If I absolutely had to have it within the LCD files then it would be within the LCD class.

By creating the object in the header file outside of any class you risk making multiple copies in different CUs.
Why not visit my shop?
Universal IDE:
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".

Post Reply