Arduino outputs

I would like to know how to read a port, digital or analog, will have a high signal for 1s then go down 1s and successively (as a blink) or shut down totally indefinitely, I need to configure a digital output, if this input is flashing the output signal is high, if it is off, it will be low.


Here is something for you to consider

I assume that you know how to read the state of a digital pin or an analogue pin being used as a digital pin. If so, then when the pin goes LOW save the value of millis() and keep going round loop() until either

1 - the pin goes HIGH (the input is flashing)
in which case set the output pin HIGH


2 - current millis() - start millis() >= 1 second (the input is not flashing)
in which case set the output pin LOW

There is actually more to think about but this should give you some ideas