Call function (char input)

before void setup() I defined 'char t[3];'

This is the piece of the code I want to put inside a specific function..

if (flag) {
  previousMillis = currentMillis; 
  screen.setTextSize(5);
  screen.text(t, 50, 40);
  flag=!flag;
}

if (currentMillis - previousMillis > interval) {
       previousMillis = currentMillis; 
       screen.background(250, 250, 250);
        
       flag = !flag;

      }

I want to make a funtion outside the loop to call whenever I need to! I want to create something like:

CalcVal(t); - when I call this function it will input the char 't' inside the screen text definition... I know how to do it when using int or float, but I have never done this with a char. How can this be solved?

Thanks, António

I know how to do it when using int or float, but I have never done this with a char

Try it and see what happens. Report any problems here and get help if necessary. What type of variable is the first argument to the screen.text() function ?

A string, I guess!

amlo13: A string, I guess!

Don't guess. Go look.

Ok, thanks :slight_smile:

If the variable is declared as global (which seems to be the case) it will be accessible in the function without needing to be passed to it.

...R