MakeCode Microbit 遙控機器人 (Microbit Remote-Controlled Robot)

本篇文章將講解如何製作一個簡易的遙控機器人,此篇文章所使用的機器人為【 麥昆智能小車 (Maqueen) 】。This post will build a simple remote car with Maqueen which is a micro:bit based robot platform for education.

一、功能如下(Game Design):

訊號說明(The communication way):

使用英文字母f、b、l、r、s 五個字母,對應動作為:f 為前進、b 為後退、l 為左轉、r 為右轉、s 為停止。Using the first letter of each action: forward, ackward, eft, ight, top. That is, the letter f stands for forward. The letter b stands for backward, and so on.

遙控器(The controller)

  • 按下 A + B 按鈕時,送出停止(stop)訊號。Sending a stop signal when button A and B are pressed.
  • Microbit 板子向上傾斜時,送出前進f(forward)訊號。Sending a forward signal when tilting the microbit front.
  • Microbit 板子向下傾斜時,送出後退b(backward)訊號。Sending a backward signal when tilting the microbit back.
  • Microbit 板子向左傾斜時,送出左轉l(left)訊號。Sending a left signal when tilting the microbit to the left.
  • Microbit 板子向右傾斜時,送出右轉r(right)訊號。Sending a right signal when tilting the microbit to the right.
  • 收到停止(stop)訊號時,車子停止。On receiving a stop signal, the car will stop.
  • 收到前進f(forward)訊號時,車子前進。On receiving a forward signal, the car will move forward.
  • 收到後退f(backward)訊號時,車子後退。On receiving a backward signal, the car will move backward.
  • 收到左轉l(left)訊號時,車子左轉。On receiving a left signal, the car will turn left .
  • 收到右轉r(right)訊號時,車子右轉。On receiving a right signal, the car will turn right .

遙控器(The controller)

  • 按下 A + B 按鈕時,送出停止(stop)訊號。Sending a stop signal when button A and B are pressed.
  • Microbit 板子向上傾斜時,送出前進f(forward)訊號。Sending a forward signal when tilting the microbit front.
  • Microbit 板子向下傾斜時,送出後退b(backward)訊號。Sending a backward signal when tilting the microbit back.
  • Microbit 板子向左傾斜時,送出左轉l(left)訊號。Sending a left signal when tilting the microbit to the left.
  • Microbit 板子向右傾斜時,送出右轉r(right)訊號。Sending a right signal when tilting the microbit to the right.

三、結果(The Results)
影片(Demo Video):

Originally published at https://yunlinsong.blogspot.com.