Sensor APIs
Access device sensors like accelerometer, gyroscope, and ambient light sensor. Perfect for creating responsive, context-aware web applications.
Accelerometer
Detect how a device is moving or shaking. This example shows how to measure acceleration forces in all directions, which is perfect for creating motion-controlled games, step counters, or detecting when a user picks up their device.
Output
Click Run to see output...
Orientation Sensor
Find out which way a device is pointing in 3D space. This example demonstrates how to track a device's position and rotation, which is useful for augmented reality experiences, 3D visualizations, or compass applications.
Output
Click Run to see output...
Ambient Light Sensor
Measure the brightness of the environment around a device. This example shows how to detect light levels, allowing your app to automatically adjust its display brightness or switch between light and dark themes based on surrounding lighting conditions.
Output
Click Run to see output...