3370Views4Replies

Author Options:

Multiple "void setup" in Arduino sketch? Answered

Hello !
Can I use more than one '''void setups' simultaneously in one arduino sketch. Something like that -

void setup()
{
code 
}
void setup1()
{
code 2 
}
void setup2()
{
code 3
}
I saw in here that I can run multiple "void loops" simultaneously in sketch.

4 Replies

user
-max-Best Answer (author)2015-12-26

You can certainly use custom functions. 'void' can be changed to another datatype, so that the functions can return things like arrays, integers, characters, etc. (a.k.a it is the output) You can also pass arguments into functions (whese are basicly inputs.)

Select as Best AnswerUndo Best Answer

user
JānisK15 (author)2017-02-08

Hello. How can i run this two loops at same time?

Select as Best AnswerUndo Best Answer

user
Downunder35m (author)2015-12-26

Well, it is explained quite simple and direct, so why not just follow and do it?
Those examples for librairies and other things are there to be used ;)

Select as Best AnswerUndo Best Answer

user
steveastrouk (author)2015-12-26

What happens if you try it ?

Select as Best AnswerUndo Best Answer