The clock and your location
Section 10: SensorsLesson 10.2 · ⏱ 9 min


- 📍 find my location asks the phone where it is. It will ask you for permission first.
- latitude and longitude are the two numbers of a place on the map.
- 🕒 clock gives the hour, the minute, the second or the whole time.
📌 Note
Sensors work better on a real phone: open your app on it (lesson 12-1).
📌 Another example: a digital clock
Every second we write the hour, the minute and the second.



✍️ 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 only the second, and it changes every second.
👀 Show the solution🙈 Hide the solution



Result: the second's number.
Medium
Good morning before 12 o'clock, and good evening after it.
👀 Show the solution🙈 Hide the solution



Result: a greeting that fits the time.
Hard
A button that finds your location and writes the latitude.
👀 Show the solution🙈 Hide the solution



Result: the latitude in numbers.

