hi,what is the correct syntax to implement a function that writes a variable text and how you call it?
i tried this but dos is not working!
else if ((millis()-StartTimerTasto) > DelayTimerReset && (millis()-StartTimerTasto < 8000)){
char text;
text ="RESET";
menu(text);}
void Menu(char testo){
display.fillRect(79,0, display.width()-48, display.height()-23, BLACK);
display.display();
display.setTextColor(WHITE);
display.setCursor(80, 1);
display.setTextSize(1);
display.print(testo);
display.display();}
char text;
text ="RESET";
Does not compile so you need to sort that out first.
Arank
4
When posting to the forum please, use code tags "</>".
As already pointed out, this should work.
else if ((millis()-StartTimerTasto) > DelayTimerReset && (millis()-StartTimerTasto < 8000)){
menu("RESET");}
void Menu(char *testo){
display.fillRect(79,0, display.width()-48, display.height()-23, BLACK);
display.display();
display.setTextColor(WHITE);
display.setCursor(80, 1);
display.setTextSize(1);
display.print(testo);
display.display();}
You don't even need to create a variable just to parse it's hardcoded value to a function, you can parse it directly.