GPS and compass code