How to call a void function in a void function.

I recently started with Arduino-IDE because i decided to make musical floopy drives as my final project in school. It is kinda complicated but basicly the thing i need to do now is have to have one void function to call on two other void functions. Kinda like this

void loop()
{
Function3();
}

void Function3()
{
void Function1();
delay(100);
void Function2();
}

void Function1()
{
do something
}

void Function2()
{
do something else
}

I know that this doesn't work but I need something similar to this to make the whole thing work. Please if you have any tips or ideas leet me know :slight_smile:

void Function3()
{
 void Function1();

When you put void in front of Function1, it makes this a declaration statement, not an executable one.
Just change it to

  Function1();

Pete

1 Like

Thanks man, that really helped me out alot!

Indeed exactly how you do the call from loop() (also a "void function") you can call functions from other functions.

void Function1() 
       {
        do something
        }

void Function2() 
        {
         do something else
         }

 void Function3()  
        {
          Function1();
          delay(100);
          Function2();
         }

void loop()
       {  
        Function3();
       } // end of loop

I put all my other voids before void loop()
and I indented your sketch to show what you have.
and removed the offending 'voids'
and I used 'code tags' as explained in "how to youse this forum"
(sorry USE. got that N.J. accent when we ask "youse guys wanna get some lunch?"

delay() will kill any hope for fast or continuous execution times.

I think I see your approach. very clever.

They aren't "voids", they are functions.

Pete

That's the way of saying that lets you know the secret handshake you can't be in the club because we don't use the words that are written to describe the things that we mean

I know you did not make the rules and I did not make the rules I'm just trying to be easy to understand

Ah. Gotcha. Youse guys are just tryin to be unnerstannable to them guys.

Pete