Calling a class that was declared/defined in another .cpp file

Forgive me if I'm getting define and declare mixed up. I'm using a library for an OLED screen in a .cpp file, declared as "display". So calling functions looks like:

display.drawRect(0, 0, 12, 12, WHITE);

It works fine, but the .cpp file with the primary declaration is getting bloated, so I want to make another page to fit the multiple functions I'll have going onto the screen. When I create a new file with

#include "all.h" // not sure if necessary to mention that there is a master header file
#include "display.h" // where the working display functions currently live

I predictably get a "display was not declared in this scope". What else is necessary to include in the secondary file in order for it to recognize "display.xxx" ?

hello. did you check the Arduino recommendations ?

this helped me. not sure it's your case.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.