First off put the two pinMode lines in setup.
next as you don't actually use duration_1 to do anything then it is no supprise that it does nothing. The line
if (duration_1 <= 1200)
{
}
else
{
might as well not be in the code for all it does.
First off put the two pinMode lines in setup.
next as you don't actually use duration_1 to do anything then it is no supprise that it does nothing. The line
if (duration_1 <= 1200)
{
}
else
{
might as well not be in the code for all it does.