I am trying to get the code to work with 2 spikes. It works with 1 spike, but I'm still a little confused on how to modify.
Code:
if(initVar != 1)
{
relay2_fwd != relay2_rev;
initVar = 1;
}
if (p1_sw_trig && !oldstate)
{
relay1_fwd = !relay1_rev;
relay1_rev = !relay1_fwd;
relay2_fwd = !relay2_rev;
relay2_rev = !relay2_fwd;
}
if (p1_sw_trig != oldstate)
oldstate = p1_sw_trig;
I initialized the relay2 fwd & rev so it was opposite. Otherwise the code was pretty much the same.
I am not sure where to procede from here.