Accessing the compass programmatically