various codes for using compass with raspi