Skip to main content

Case 06 Memory Test Game

Introduction

This lesson will lead students to create a memory game using the Nezha Inventor's Kit V2 and AI Accessories Pack. By learning the colour recognition technology, students will be able to make the device light up according to the order of the recognised colours. Players then need to put in the corresponding colour cards according to the order of the light colours, and the player who puts in the cards in the correct order and colours will win the game.

Teaching Objectives

  • Understand the basic principles of colour recognition.
  • Learn the operation of colour recognition using the AI lens.
  • To master methods of combining colour recognition with device control.
  • To develop students' hands-on practical skills and creative thinking.

Teaching Preparation

Nezha Inventor's Kit V2

AI Accessories Pack

A computer

Teaching Process

Introduce

The teacher can guide students to think about the following questions: What are some other interesting real-life applications of the colour recognition function? Through these questions, students' interest is stimulated and they are led to think about how to combine technology with creativity.

Hello everyone, today we will work together to create a very interesting memory game. In this game, the device will light up with different colours first, and then players need to put in the corresponding colour cards according to the order of the light colours. If the player puts the cards in the correct order and colour, then he wins. So, how is this memory trivia game achieved? Let's explore it together!

Exploration

Group discussion to get students thinking about how to create a fun trivia game with an AI lens.

  • How can we optimise the difficulty and fun of a memory trivia game?

Practice

Work in groups to make a memory game with blocks according to your own design.

Make a memory game with blocks according to your own design.

Samples

Building Steps

Assembly Finished

Hardware Connection

Connect the rainbow LED to J1 and the AI lens to IIC on the Nezha expansion board.

Software Programming

Go to makecode

Create New Project

Click Extensions

Search with planetx and download the package.

Code

Link: https://makecode.microbit.org/_M2uiPfajCEjA

You may download it directly below:

Teamwork and Presentation

Students are divided into teams to work together on the production and programming of the case.

Students are encouraged to co-operate, communicate and share their experiences with each other.

Each team has the opportunity to present the cases they have produced to other teams.

Example Case Results

The memory game device identifies the colour of the card by using the colour recognition function of the AI lens. After the player presses the logo, the device first lights up with different colours, then the player needs to put in the corresponding colour cards according to the order of the light colours and press button A to confirm, and finally press button B to confirm that all the operations have been completed, and finally the device will judge the cards according to the order of the cards being put in and their colours. Finally, the device will judge according to the order and colour of the cards, and when the order and colour of the cards are correct, the game is won.

Reflection

Sharing in groups allows students in each group to share their production process and insights, summarise the problems and solutions they encountered, and evaluate their strengths and weaknesses.