Start and Stop Stepper with Accel Library

Hi Nick. All I did was substitute your recommended code change into my changeRelayState and the relay wouldn't come on afterwards. I put original code back and it comes on. As you are probably aware I am new to all this. So please go easy on me.

Original Code

void changeRelayState()
{
    if (ms - msLast > (relayState ? relayOn : relayOff))
    {
      digitalWrite(relayPin, relayState = !relayState);
      msLast = ms;
    }
}

New Code

void changeRelayState()
{
    if (relayState == relayOn)
     relayState = relayOff;
  else
     relayState = relayOn;
     digitalWrite(relayPin, (relayState == relayOn) ? HIGH : LOW);
     msLast = ms;
}