| Tilt Angle () | |
(tilt angle ( v):: microbit) | |
| Category | micro:bit |
| Type | Reporter |
| Introduced in | 3.0 |
The tilt angle () block is a reporter block and a micro:bit block. Its options are "front", "back", "left", and "right". The block returns the micro:bit unit's tilt angle in degrees in the specified direction.
Example Uses
- Controlling movement in a game
forever change x by ((tilt angle (right v)::microbit) * (0.02)) change y by ((tilt angle (front v)::microbit) * (0.02)) end
- Measuring angles as an inclinometer
set [known distance to object base v] to [12] say (join [Calculated object height: ] ((known distance to object base) * ([tan v] of (tilt angle (front v)::microbit))))