You presently start with zeroCrossingFlag = false. After you attach the interrupt the flag should be set to true if things are working correctly.
That was just something to start, did not know where to start at, hence added that line.
not sure if i've got what you meant but here is how i got it
attachInterrupt(0, setFlag, FALLING);//zero cross detect
zeroCrossingFlag =false; //make sure interrupt has not been triggered by attachInterrupt
delay (500);//wait to get an interrupt triggered
if(!zeroCrossingFlag) //zeroCrossing Flag has not been set true by the interrupt during the delay period
{
digitalWrite(led, HIGH);
digitalWrite(rst, HIGH);
}
during compilation, an error was returned "Arduino: 1.6.11 (Windows 8.1), Board: "Arduino/Genuino Uno"
zce_detect:6: error: expected constructor, destructor, or type conversion before '(' token
attachInterrupt(0, setFlag, FALLING);//zero cross detect
^
zce_detect:7: error: 'zeroCrossingFlag' does not name a type
zeroCrossingFlag =false; //make sure interrupt has not been triggered by attachInterrupt
^
zce_detect:8: error: expected constructor, destructor, or type conversion before '(' token
delay (500);//wait to get an interrupt triggered
^
zce_detect:9: error: expected unqualified-id before 'if'
if(!zeroCrossingFlag) //zeroCrossing Flag has not been set true by the interrupt during the delay period
^
exit status 1
expected constructor, destructor, or type conversion before '(' token"