Use the Arduino UNO with the DS1302 RTC Module to print the time on the serial monitor when it receives a continuous signal. I just want to get the start and end time. That is, I want to record the time when the signal is received and the time when it is interrupted.
I want to show this result:
Signal start time : YYYY/MM/DD HH:MM:SS
Signal break time : YYYY/MM/DD HH:MM:SS
I already tried a lot of codes but didn't find the solution.
If by continuous signal you just mean a pin changing from low to high and then back to low later (or high to low and back to high) you could probably draw on the approach taken in the state change detect example at file / examples / 2 digital in the ide. Just get it first to recognise those changes and report in the ide "start of signal" and "end of signal".
What is the difference between them.
The problem here is that the iterative loop is in conflict with the void loop function. Because instead of working only once and checking the condition, it continues to work every time.
X=1 is an assignment. X==1 is a comparison. Putting an assignment in a loop condition doesn't make sense. Indeed, a comparison in a loop conditional makes no sense unless you change the condition within the loop.
I have no idea what you mean by "iterative loop is in conflict with the void loop function".