Using the Heltec display SSD1306Wire.h style... (Tutorial)

Hi,
Heltec appears to use its display using their own library.
It is fine and easy to use.
However the syntax for display primitives is different:
with SSD1306Wire.h you write e.g.

display.drawString(10, 0, "| Set");

with SSD1306Wire.h you write e.g.

Heltec.display->drawString(10, 0, "| Set");

If you have a lot of existing code, that must run on both architectures, you might want to use the same syntax.

You can mange that easily:
You run the heltec.h library and initialize normally.

Just after setup(); and after loop(); add this line

auto &display = *(Heltec.display);

Then you can use all code written for the SSD1306Wire natively.

Enjoy!

Credit: PieterP on
Arduino Forum

This is a very good idea, thank you very much for your suggestions.