I am Aamir Attar and i am an Embedded developer. I am doing my project based on IOT using PIR motion sensor and came across 1 doubt which i hope that u guys will help me with that.......
(?) is it possible to use two "setup ()" statements in one program ???
(?) if yes...then hw to use it ???
"i think it can be used as nested loops or something...if i m nt wrong !!!"
Aamir_Attar:
(?) is it possible to use two "setup ()" statements in one program ???
No, each function must have a unique name.
Why would you even want two setup() functions?
Aamir_Attar:
(?) if yes...then hw to use it ???
If you really want one:
void setup() {
// put your setup code here, to run once:
setup2(); // run the setup2 function
}
void setup2() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}