to mr Brian,
im very sorry not to mentioned how this circuits work.
for V2, actually it is a port later to be connected with Earth Leakage Relay (ELR)
when ELR trip, it will transmit a 230VAC signal to the port V2.
i already apply transformer, bridge rectifier and voltage drop circuit before input of V2.
therefore, i expect a 5V signal to be the input for the RA0 as a fault signal.
for the coding,
i'm very new, so i need help over here
what i want to do,
first in normal condition,
RA2 will always on, to indicate the system is in normal condition.
when ELR trip and send fault signal to RA0,
i want RA2's LED to be turn OFF, and turn on RA3's led.
after 7 second (in order to allow enough time for leakage current flow to the ground),
RA1 will send a 5V as its output. may anyone help me?