You do not need parallel processing or finite-state machines for that:
// Vector with digital pin numbers for LEDs (with resistor to ground)
const int LED_MAX = 5;
const int LED[LED_MAX] = { 2, 3, 4, 5, 6 };
// Vector with analog pin numbers for LDR (with pullup resistor)
const int LDR_MAX = 5;
const int LDR[LDR_MAX] = { A0, A1, A2, A3, A4 };
// Analog value or lower when to light the LED
const int THRESHOLD = 200;
void setup()
{
// All LED pins should be digital output pins
for (int i = 0; i < LED_MAX; i++)
pinMode(LED[i], OUTPUT);
}
void loop()
{
// Read all LDRs and set LED pins according to threshold
for (int i = 0; i < LDR_MAX; i++)
digitalWrite(LED[i], analogRead(LDR[i]) < THRESHOLD);
}
But if you really want to describe this as multiple tasks you could use the Simple Scheduler library:
#include <Scheduler.h>
const int THRESHOLD = 200;
template<int LED> void setup()
{
pinMode(LED, OUTPUT);
}
template<int LED, int LDR> void loop()
{
digitalWrite(LED, analogRead(LDR) < THRESHOLD);
yield();
}
void setup()
{
Scheduler.start(setup<2>, loop<2, A0>);
Scheduler.start(setup<3>, loop<3, A1>);
Scheduler.start(setup<4>, loop<4, A2>);
Scheduler.start(setup<5>, loop<5, A3>);
Scheduler.start(setup<6>, loop<6, A4>);
}
void loop()
{
yield();
}