AirPodsPro Motion Sampler

This project is a sample to get the motion sensor values of the AirPods Pro(1st or 2nd gen) / AirPods Max / AirPods(3rd gen) or Beats Fit Pro.

290
35
Swift

AirPodsPro-Motion-Sampler

Code Examples of CMHeadphoneMotionManager in CoreMotion.

Requirements

  • Xcode: 12.0+
  • iOS : 14.0+
  • iPhone, iPad (*1)
  • AirPods Pro(1st or 2nd generation) / AirPods Max / AirPods(3rd generation) or Beats Fit Pro

*1: iPod Touch (7th generation) is not supported.
*2: The necessary sensors are included, so it should work.

How To Build

Open AirPodsProMotion.xcodeproj on Xcode12 or later, then connect your iPhone or iPad to build it.

Contents

Infomation View
Rotate the Cube
By Head Motion
Table scrolling
By Head Motion
Export motion data to CSV
 
 
  
  
  • infomation View
    Displays the information (CMDeviceMotion) obtained from AirPodsPro.

  • Rotate the Cube By Head Motion
    The cube rotates in sync with the orientation of the face.

  • Tabel scrolling By Head Motion
    Move the face up and down to scroll the TableView.
    We don’t use any hands at all.

  • Export motion data to CSV
    Export the motion data acquired from AirpodsPro as a CSV file.
    You can check the data by using a file App.
    For more information, a CSV file is stored in the ‘Files App > On My iPhone > AirPodsPro’ directory.

Reference

Author

Yoshio Tsukuda