I'm writing a new Arduino project that uses an 16x2 LCD Crystal Display with a KeyShield. I would like to construct a menu structure in which the user can navigate using the buttons.
I'm new to Arduino but I do have 5 yrs experience in C#. What I would like to do is the following:
Define an interface called Screen and inherit each Screen from it such as LanguageScreen, TurnOffAfterScreen, MainScreen, etc. Each specialized Screen implements a method called drawScreen that will take care of the screen content.
Now I would like to have a class named ScreenController that handles the navigation between the Screens. In this class I'd like to store the screens in an array Screen screens[3].
When user presses the Select button on the KeyShield the Controller would call the next Screen's drawScreen method something like this:
void showNextScreen()
{
currentScreen++;
screens[currentScreen]->drawScreen();
}
Is this possible to do in an Arduino project? Am I expecting too much? :)
Screenwould have to be an (abstract) base class, and your array would have to beScreen * screens[3]. \$\endgroup\$