I'm working on project and i need to detect a pulse of the previous user.
So if the previous user send a pulse I need to detect it so that my project can start working and if it doesn't send a pulse it does nothing but the pulse is not a contonious pulse it is a pulse that has been send once and once the pulse has been detected than mine project can start.
It is a digital pulse but the thing that I am thinking about is: if it is a pulse that is send once and how to detect it and then you don't have to worrie aboutit anymore. because if you use a if statement it just detect it but once the pulse isn't HIGH anymore then the program stops. can you prevent it from stopping or not or do you have to get a constant signal.
the pulse is not a contonious pulse it is a pulse that has been send once and once the pulse has been detected than mine project can start.
Your first job is to detect the pulse. What code do you have to do that? The state change example of the 02 Digital ide examples may be useful to you.
if it is a pulse that is send once and how to detect it and then you don't have to worrie aboutit anymore
Once you detect the pulse you can manage the program flow with a boolean control variable. You can call it pulseDetected.
Initialize its value to false. Then when the pulse is detected you change its value to true and let the state of that variable to allow the rest of the program to run.
if(pulseDetected == true)
{
// run what you want to do after the pulse is detected
}