Get magnetic sensor data

Sample code to get magnetic sensor data (Gear device)