Navigasi Materi

Makecode Micro:bit #14 - Motor Control

MakeCode micro:bit Lab #14 - Motor Control
MakeCode micro:bit Lab #14 Robotics Motor Control

🤖 Motor Control — Mengendalikan Motor

Indonesia: Belajar bagaimana micro:bit memberi perintah kepada motor: Forward, Backward, dan Stop. Ini adalah langkah pertama menuju robot mobil dua roda!

English: Learn how a micro:bit controls motors using Forward, Backward, and Stop commands. This is the first step toward building a two-wheel robot!

🧠 Concept / Konsep

Input → Process → Output

Tombol micro:bit menjadi Input. Program menentukan arah dan kecepatan sebagai Process. Motor bergerak sebagai Output.

Input → Decision/Command → Motor Movement

🎮 Interactive Simulator

Motor Control Simulator
STOP
micro:bit
Motor A
Motor B
50
Motor Speed / Kecepatan Motor
0100
■ STOP
0
Commands
50
Speed
STOP
Status

💡 Try changing the speed, then press FORWARD, BACKWARD, LEFT, RIGHT, or STOP.

📘 What Is Motor Control?

Indonesia: Motor control berarti memberikan perintah kepada motor agar bergerak dengan arah dan kecepatan tertentu.

English: Motor control means sending commands to a motor so it moves in a specific direction and speed.

Basic Commands / Perintah Dasar

Forward → maju Backward → mundur Stop → berhenti Speed → kecepatan

🤖 Two-Motor Idea

Robot mobil biasanya menggunakan dua motor. Jika kedua motor bergerak maju dengan kecepatan yang sama, robot bergerak lurus.

Left motor + Right motor = Robot movement

Key idea:
Speed 0 = Stop
Speed 100 = Maximum speed in this simulator
Direction determines where the robot moves.

🧩 MakeCode Program / Program MakeCode

📝 Pseudocode / Pseudocode

Indonesia: Pahami logikanya terlebih dahulu sebelum melihat programnya.

English: Understand the logic first before looking at the program.

START When button A is pressed set Motor A speed to 50 set Motor B speed to 50 move Forward When button B is pressed set Motor A speed to 50 set Motor B speed to 50 move Backward When the logo is pressed Stop both motors END
on start
set speed to 50
on button A pressed
motor channel C | speed (0~100) speed | rotation direction 1
motor channel D | speed (0~100) speed | rotation direction 0
on button B pressed
motor channel C | speed (0~100) speed | rotation direction 0
motor channel D | speed (0~100) speed | rotation direction 1
on logo pressed
motor channel C | speed (0~100) 0 | rotation direction 0
motor channel D | speed (0~100) 0 | rotation direction 0
🧩 RoboticsWorkshop: the motor block uses motor channel, speed (0~100), and rotation direction (0~1). For this two-wheel model, C and D use opposite rotation values so the two wheels can move in the same physical direction.

✏️ Practice / Latihan

Question: If both motors have the same speed and both move Forward, what will the robot do?

🏆 Challenge 1 — Make the Robot Move!

Indonesia: Atur speed ke 70, lalu tekan FORWARD. Setelah itu tekan CHECK.

English: Set the speed to 70, press FORWARD, then press CHECK.

🏆 Challenge 2 — Which Command?

Jika robot ingin bergerak mundur, command apa yang harus digunakan?

🏆 Challenge 3 — Speed Control

Ubah speed menjadi 90. Kemudian tekan FORWARD. Apa yang berubah?

📐 Math Connection / Hubungan dengan Matematika

Kecepatan motor dapat dipandang sebagai nilai pada interval 0 sampai 100.

Misalnya: 0 → stop, 50 → medium, 100 → maximum.

Ini dapat menjadi pengantar ke bilangan, skala, perbandingan, kecepatan, dan grafik.

🔧 Now Try It with a Real micro:bit!

Indonesia: Sekarang pindahkan konsep ini ke micro:bit dan motor driver/robotics kit yang digunakan di kelas.

English: Now transfer the idea to your real micro:bit and motor driver/robotics kit.

Untuk robot Bu Julianita, nanti kita dapat mengembangkan bagian ini menjadi kontrol Motor C + Motor D, lalu maju, mundur, belok, dan akhirnya menjadi robot line follower.

Open Microsoft MakeCode micro:bit ↗