Limit switch with Nema 17 and A4988

if(digitalRead(lmswitch1==LOW))

I think you meant

if(digitalRead(lmswitch1) ==LOW)