Tilting and shaking: the spirit level
Section 10: SensorsLesson 10.1 · ⏱ 10 min


- tilt left-right is the phone tilting right and left, and forward-back forward and back.
- On the computer the arrow makes the tilt 30. On a real phone the tilt changes as you tilt it.
- when the phone is shaken: on the computer press the letter S.
🖥️ What happens on the stage?
In the lab “Tilt: 30 , 0” appeared and the ball moved right, then we pressed S and it went back to the middle.
📌 Another example: the tilt arrow
It shows an arrow in the direction the phone is tilted.



✍️ Practise
Make the example yourself: put the parts in “🎨 Design”, then the blocks, and tap ▶ Run.
✍️ Practise here in the lesson✖ Close the labor open the lab in a new page ↗
🎯 Challenge yourself
Easy
Write the right-left tilt number.
👀 Show the solution🙈 Hide the solution



Result: it writes 30 when tilted.
Medium
Shaking the phone rolls a dice.
👀 Show the solution🙈 Hide the solution



Result: a number from 1 to 6.
Hard
The screen is green if the phone is level, and red if it is tilted.
👀 Show the solution🙈 Hide the solution



Result: tilted, then level.

