Possible Code Issue?

you may find helpful, Using Servos for Turnouts which uses the same components