🌙 MakeCode micro:bit Lab #10 — Night Light
English: Use a light sensor to control a lamp automatically.
Indonesia: Gunakan sensor cahaya untuk mengendalikan lampu secara otomatis.
Sensor → Condition → Output💡 Simulator / Simulasi
📊 Results / Hasil
💡 Cara Bermain / How to Play
Press RUN.
Move Light Level below 80.
Watch the lamp turn on. Raise the light above 80 and watch it turn off.
The program makes a decision based on the light condition.
🎯 Tujuan Pembelajaran / Learning Goal
/ Understand a light sensor.
/ Use an if...then...else condition.
/ Connect sensor input to an automatic output.
🚀 Coba di micro:bit sungguhan!
Try it with a real micro:bit!
Buat lampu malam otomatis menggunakan light level di Microsoft MakeCode.
Create an automatic night light using light level in Microsoft MakeCode.
Official MakeCode: makecode.microbit.org
📊 Koneksi dengan Matematika
Math Connection
Nilai sensor dapat dibandingkan dengan batas tertentu, misalnya 80.
A sensor value can be compared with a threshold, such as 80.
🧩 Program / Program
English: The micro:bit reads the light level and decides whether the lamp should be ON or OFF.
Indonesia: micro:bit membaca tingkat cahaya lalu menentukan apakah lampu harus ON atau OFF.
Key idea:
🧠 Practice / Latihan
If the light level is 40, what should the automatic lamp do?
Jika tingkat cahaya adalah 40, apa yang harus dilakukan lampu otomatis?
🏆 Challenges / Tantangan
Challenge 1 — Make the Night Light Work
Press RUN and set the light level below 80. The lamp should turn ON.
Indonesia: Tekan RUN dan atur cahaya di bawah 80. Lampu harus menyala.
Challenge 2 — Think Like a Programmer
Which part of the program makes the decision?
Bagian program mana yang membuat keputusan?
Challenge 3 — Change the Threshold
Suppose the lamp should turn ON when the light level is below 100. What number should replace 80?
Indonesia: Jika lampu harus menyala saat cahaya di bawah 100, angka berapa yang menggantikan 80?
📐 Math Connection / Hubungan dengan Matematika
Contoh: jika sensor membaca 40, maka:
Jika sensor membaca 120:
Aktivitas ini dapat dikembangkan menjadi materi tentang perbandingan, pertidaksamaan, interval, dan pengambilan keputusan.