Johan Schoeman Expert Licensed User Longtime User Jun 3, 2019 #1 RLiquidCrystal is an existing library in B4R. How would one wrap the below constructor to pass it to a wrapper for LcdBarGraph and how would one then pass rLiquidCrystal from B4R to LcdBarGraph? B4X: // -- constructor LcdBarGraph::LcdBarGraph(LiquidCrystal* lcd, byte numCols, byte startX, byte startY)
RLiquidCrystal is an existing library in B4R. How would one wrap the below constructor to pass it to a wrapper for LcdBarGraph and how would one then pass rLiquidCrystal from B4R to LcdBarGraph? B4X: // -- constructor LcdBarGraph::LcdBarGraph(LiquidCrystal* lcd, byte numCols, byte startX, byte startY)
Erel B4X founder Staff member Licensed User Longtime User Jun 4, 2019 #2 1. You need to use the placement constructor. See how B4RLiquidCrystal::Initialize is implemented. Specifically the use of (backend). 2. Your class should accept a B4RLiquidCrystal parameter and then get the hidden (see the h file) public lc field.
1. You need to use the placement constructor. See how B4RLiquidCrystal::Initialize is implemented. Specifically the use of (backend). 2. Your class should accept a B4RLiquidCrystal parameter and then get the hidden (see the h file) public lc field.