How to execute 2 functions in a simple sketch?

we have 2 functions and our idea is run together with a delay between both. we try put a simple delay time between both but no work, anyone can hepl us? thanks!!! :slight_smile:

intento_tira_leds.pde (7.05 KB)

funcion1.pde (7.54 KB)

funcion2.pde (8.28 KB)

What does "no work" mean? You must explain what you expected to happen and what DID happen in order to get the best possible help.

How did you try and combine them?
You have just got three files.
What do you mean by :-

but no work

Did it compile?
If it did, did anything run?

it compiled but 2 function is run at the same time, we expected when the first function is running with a determinated time and after 10 or 15 seconds for example, start to run the 2nd function!! these helps? ....let us know!!!thanks

but 2 function is run at the same time,

No they don't, they run one at once.

Put a delay between calling one function and the other. At present I can see no delay.
You have so much commented out in that file that it is hard to see what is happening.

Why is this post a pole?

when put a delay between 2 like this

funcion1( );
delay(3000);
funcion2( );
}

just show funcion2, start the strip lights on with funcion 2 directly, we apreciated 30s delay when start the sketch but funcion1
no shows....sorry 4to much comments!!!

Yes but if this is in a loop there is no delay between function2 and function1 so you need to do:-
funcion1( );
delay(3000);
funcion2( );
delay(3000);

That delay is only a 3 second delay by the way. Thee is no way you can get two functions to run at the same time the processor is not capable of doing this.

when put delay after funcion1 and funcion2 we apreciated the delay in funcion2:
First the strip light is on but nothing happens, after time delay run funcion2 but
never show funcion1, is like missing!! =(

Put all the functions into one file and post it, then we might stand a chance into seeing what you are doing wrong.
Do test the single file and make sure it does what you are saying before posting.

This is the entire code, it stills show the 2ยบ function first 30 secs delay, stopped, and then run. No drag of the 1ยบ function

intento_tira_leds2.pde (18.1 KB)

Functions1 and function2 only run once because they are called in the setup.

Function1 sets a lot of values and then instantly does a flush so you will not see anything. So put the delay before the flush if you want to see function1 running.
If you use values over 32,000 in delay then put a UL on the end of the number because 32,00o or so is the limit of an integer.