Created
March 21, 2024 15:32
-
-
Save mcavalcantib/4664c3345e61c3b96929010c724dc57b to your computer and use it in GitHub Desktop.
Revisions
-
mcavalcantib created this gist
Mar 21, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,44 @@ #include <stdio.h> long stateStart = 0; // fun_ptr is a pointer to function fun() void (*UpdateFunction)(void); void ManualMode(){ //Acoes de exibir e controlar o modo manual if(selectButton && option == 2){ //opção 2 cancelar UpdateFunction = &MainMenu; } } void MainMenu(){ // funções de exibir as opções na tela //... if(selectButton && option == 1){ // opção 1 manual UpdateFunction = &ManualMode; } } void SplashScreen() { if(millis() - stateStart < 3000){ PrintSplash(); }else{ UpdateFunction = &MainMenu; } } int main() { //setup UpdateFunction = &SplashScreen; //loop while(1){ UpdateFunction(); } return 0; }