I have already tried the exact same thing you are doing with this and surprisingly, it didn't work. But with lots of trys we finally found something that did:
if(!p4_sw_trig){
if(counter1 > 9 & counter1 < 61)
{
counter1++;
}
else if(counter1 < 10 || counter1 > 60)
{
counter1 = 0;
}
} else if(p4_sw_trig){
if(counter1 < 1000)
counter1++;
}
if(counter1 == 10)
{
relay4_fwd = !relay4_fwd;
}
if(counter1 == 30)
{
relay3_fwd = !relay3_fwd;
}
if(counter1 == 50)
{
relay3_fwd = !relay3_fwd;
}
if(counter1 == 60)
{
relay4_fwd = !relay4_fwd;
}
I don't know why this worked and that didn't but it works and I'm happy. Thanks, everybody, for helping out.
