To come back on the main question I have summarised the wanted functionality
summarised description excerpt from a posting above
Used microcontroller:
Bare bones Atmega 328P w/ 16Mhz crystal and caps, 5v supply
The microcontroller "sleeps" all day in POWER_DOWN_MODE, and the µC "wakes" up at night by monitoring a LDR & 56K divider with a threshold of 200.
WHEN the microcontroller wakes up the first thing it does is power a PIR directly from an IO-pin of the 328P,
The IO-pin delivers power to the PIR until the microcontroller goes back to sleep.
When the PIR is activated (senses a person walking by) this shall be detected by the code and start these actions
switching power on for the Adafruit FX stereo Sound Board
switching on power for the servo
Making the servo sweep 15 times to very different angles and different delays between each sweep.
These action go on for 18 seconds
After 18 seconds the power for the soundboard and the servo shall be switched of to save power.
Only the microcontroller itself stays powered on until the LDR-circuit detects "ambient light is above threshold"
which will put the microcontroller back into POWER_DOWN_MODE.
15 different servo-positions and 15 delay-times can be stored in the struct like suggested by user @UKHeliBob
steps inbetween on the way to complete functionality
taking a demo-code that does nothing more than
drive servo to position A
wait for some time
drive servo to position B
wait for some time
repeat
expanding this demo-code to use the numbers for position-angle and delaytime
stored in an array build of type struct phaseData
Taking a new demo-code that does nothing more than
switch on an LED
wait 2 seconds in a non-blocking way
switch off an LED
wait 1 second in a non-blocking way
repeat this infinitely
modifying the LED-on/off-code to only switch LED on when a button is pressed
(which simulates the PIR-signal)
and switch off LED after some seconds
and then again wait for the button-signal
combining wait for signal-code=>do action for 18 secpnds
with the switch on soundboard / sweep servo code
best regards Stefan