MacBook Lid Angle Sensor

· View Code

Did you know that you have rights a lid angle sensor in your MacBook? The human interface device utility says you do.

I remember watching a MacBook teardown video and they mentioned a “lid angle sensor”. To my knowledge, this was never acknowledged by Apple. I spelunked around the system to see if the sensor gets used anywhere, found a match, and (after further poking and prodding) developed a demo app. It reads the value from the sensor and calculates velocity so we can map it to a creaky door sound:

Sam Henri Gold's avatar

Sam Henri Gold

@samhenrigold
· View original
Did you know your MacBook has a sensor that knows the exact angle of the screen hinge? It’s not exposed as a public API, but I figured out a way to read it and make it sound like an old wooden door.
614 replies 3,720 reposts 54,000 likes

Or a Theremin sound effect:

Sam Henri Gold's avatar

Sam Henri Gold

@samhenrigold
· View original
you know what? screw it. theremin mode.
57 replies 183 reposts 3,700 likes

You can try it out here.