Skip to content

AI and Micro:bit Magical Adventure: Let's Make Our Robot Move!

Welcome to this magical world of programming, kids! Today we're going to learn how to use Micro:bit and AI together to control our Plenbit robot. Are you ready? Let's begin!

Step 1: Meet Our Programming Friends

  • Micro:bit: Our small computer with an LED screen
  • Plenbit: Our obedient robot friend
  • AI: A super smart computer brain that sends instructions
  • YunDo: A tool that helps AI and Micro:bit communicate

Step 2: Open the MakeCode Programming Environment

Click the "Open MakeCode" button on the page to enter our programming studio.

Step 3: Create the Main Program Loop

  1. Find the "Basic" category in the toolbar
  2. Drag the "forever" block to the programming area

Step 4: Set Up YunDo Connection Response

  1. Find the "on YunDo connected" block in the "YunDo" category
  2. Drag it to the programming area
  3. Place a "show icon" block inside it and choose a smiley face icon

Step 5: Write the Program to Receive Instructions

  1. Find the "on YunDo data received" block
  2. Drag it to the programming area

Step 6: Handle the "HEART" Instruction

  1. Find the "if...then" block in the "Logic" category
  2. Place it inside the "on YunDo data received" block
  3. Set the condition to "received data = HEART"
  4. Place a "show icon" block inside and choose a heart pattern

Step 7: Handle the "MOVE" Instruction

  1. Add an "else if" block
  2. Set the condition to "received data = MOVE"
  3. Place a "show icon" block inside and choose an arrow pattern
  4. Add a "Plenbit walk forward" block below (found in the "Plenbit" category)

Step 8: Handle Other Instructions

  1. Add an "else" block
  2. Place a "show string" block inside
  3. Set the display content to the received data

Congratulations! You've completed the programming. Now your Micro:bit can follow AI instructions.

Tips:

  • If you encounter anything you don't understand, don't forget to click the AI assistant button in the bottom right corner. It will be happy to answer your questions!
  • Try changing the heart or arrow patterns to make your program more unique.
  • Think about what other fun instructions you could add?

Challenge:

Can you make the Plenbit robot dance? Try adding new instructions and actions to your program!

Remember, programming is like learning magic - it takes practice and patience. Don't get discouraged if you face difficulties. Ask the AI assistant or try a few more times on your own. You'll definitely become an amazing programming wizard!

Happy coding! If you have any questions, feel free to ask the AI assistant anytime!