I have been doing a few Arduino projects, and I am familiar with Arduino, I use visual micro and visual studio 2019.
One of my projects it is becoming very big (using Arduino mega), I want to have all the code more modulated and I made a few classes for each dedicated things, for instance I have an abstract class game with 3 gametype classes inhering from game and also I have classes for the mp3 player, leds, lcd etc...
My question is which is the best way to access from one of this classes to the others? Using extern? I don't know if we can do extern from an ino file, should I move all to a main class and do extern from that class? or should a write a singleton pattern?
I had all the declarations on my main Ino file, at that was working fine but but now that all is modulated I don't know how to access the variables from inside the child classes
Ino file (Main file with all the initialization of other classes)
LedManager - FXLibrary
Game- Game 1
SoundsClass - Piano
For instance, what is the best way in Arduino to play the methodes inside Mp3Player from Game1 class? Or the lcdprint methode incide LCD class from Piano
Thank you very much,