Motor and sensor simulation code