slave motorcontroller code