Adafruit I2C Backpack

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

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? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"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