Optomechanical devices, which simultaneously confine light waves and mechanical waves to permit interaction between them, can be used to study fundamental questions in physics and to sense motion similarly to electromechanical accelerometers. In smartphones, these electronic components switch the touchscreen between portrait and landscape when they detect rotation by the user.