💡 MakeCode micro:bit Lab
🇬🇧 Learn how a micro:bit can make a decision using an if...then...else statement.
🇮🇩 Memahami bagaimana micro:bit dapat mengambil keputusan menggunakan perintah if...then...else.
🖥️ Simulator
🧩 Program
English:
If the light level is below 50,
turn the lamp ON. Otherwise,
turn the lamp OFF.
Indonesia:
Jika tingkat cahaya kurang dari 50,
nyalakan lampu. Jika tidak,
matikan lampu.
The micro:bit checks the light level again and again.
Micro:bit terus memeriksa tingkat cahaya dan menentukan apakah lampu perlu menyala.
🎯 Practice — Latihan
The light level is 30. What should the automatic lamp do?
Jika tingkat cahaya adalah 30, apa yang harus dilakukan lampu otomatis?
🏆 Challenges — Tantangan
Challenge 1 — Make the Lamp Turn ON
Set the light level below 50. Then observe the lamp.
Atur tingkat cahaya di bawah 50, kemudian amati lampunya.
Challenge 2 — Find the Decision
Which block makes the micro:bit choose between ON and OFF?
Blok mana yang membuat micro:bit memilih antara ON dan OFF?
Challenge 3 — Change the Threshold
Suppose the lamp should turn ON when the light level is below 30. What threshold should you use?
Jika lampu harus menyala ketika tingkat cahaya kurang dari 30, berapa batas (threshold) yang digunakan?
Now Try It with a Real micro:bit!
English
You've practiced with the simulator.
Now create your automatic light program
using the real Microsoft MakeCode editor.
Indonesia
Kamu sudah berlatih menggunakan simulator.
Sekarang buat program lampu otomatis
menggunakan Microsoft MakeCode yang sesungguhnya.
- Open Microsoft MakeCode for micro:bit.
- Create a new project.
- Read the light level using the micro:bit.
- Use an if...then...else block.
- If the light is low, turn on the LED.
- If the light is bright, turn the LED off.
Official Microsoft MakeCode for micro:bit
Learn → Simulate → Think → Create