Hello fellow Arduino-Friends.
First of all hello to everybody:) I am brand new here
and this is my first post.
So far I am a few steps further than the blinking-LED
And now I have a nice little project going that really grows
with my understanding of the arduino board as well as electronics
in general but still there is a long way to go.
Since using the Arduino the last few days I am amazed how quickly
one can get useful results by puzzling some code elements together
while developing some understanding and try to figure out how everything works.
Also the forum here is a breeze. ALways when I was on the verge of
posting a question I kept working on it and read a few threads more
and mostly got everything going really good.
But now I am a little confused about set-ups & voidLoops and I can’t hold
my question back no more:)
So here it goes:
I got to different things going on but the are run by the arduino
in serial. I try to give out cv in parallel so that the processes
don’t get in the way of each other
So now to give a basic example that simplifies the most of what
I am trying to achieve at this point:
// I’ve got this little example piece of code
// That turns two LEDs on and off respectively
int LED1 = 12;
int LED2 = 11;
void setup() {
 pinMode(LED1, OUTPUT);
 pinMode(LED2, OUTPUT);
}
void loop() {
 digitalWrite(LED1, HIGH);
 digitalWrite(LED2, HIGH);
 delay(500);
 digitalWrite(LED1, LOW);
 digitalWrite(LED2, LOW);
Â
 delay(200);
}
Now I want them to process in parallel not serial
Stupidly explained I want to add more independent loops:
SetUp 1 -> pinMode LED1
Void Loop 1 -> digiHIGH (delay500) digiLOW (delay200)
SetUp 2 -> pinMode LED2
Void Loop 2 -> digiHIGH (delay50) digiLOW (delay40)
// In my research I've found this example from an old threat:
void setup()
{
  setupPart1();
  setupPart2();
  setupPart3();
}
void loop()
{
  loopPart1();
  loopPart2();
  loopPart3();
}
// Together with the information:
// "if you have three bits of ... don't throw them all together"
// "join them slowly one at a time."
// "You will need to initialize all your global variables"
// Thanks for contribution:)
I think I am on the right track here but quite honestly I don’t know
how to implememt it.
I've tried to apply it onto my code but can't quite figure out
how to properly do that. I am a real noob with this.
I’ve tried with this:
My general understanding of the Arduino code is
really at beginne-level.
So I think you have to name the setups/voids specifically and then
use them.
Maybe I am just to blind and it’s more easy then I thought.
Hope somebody can help me with this:)
Thanks a bunch and a great weekend to all!!
hXw