Measuring Rotation Angles
Example project: test_accel_xy_angle
- Enter this project and name it test_accel_xy_angle.
- Flash the project into the micro:bit.
- Open the terminal.
- Verify that the angles reported are correct as you hold the micro:bit vertically, and rotate it to: 0°, 30°, 45°, 60°, 90°, 135°,180°, 225°, 270°, 315°, and 360°. Make a note of x, y, and angle for each rotation.
- Repeat the rotations, but for each vertical rotation, tilt it away from you by 45° before measuring. As before, note the x, y, and angle values.
- Divide x into y at 45° rotation.
- Divide x into y at 45° rotation plus 45° tilt-away.
Are both results close to 1?
- Repeat for 90° and 135°.
See how the x and y values are different for rotated vs. rotated+tilted but the y/x ratios work out to the same?