Flip a coin
Introduction
In soccer, the referee usually decides which team will kick off first by tossing a coin. Before the match begins, the referee calls the captains of the two teams and then makes a coin toss, where the team that wins the toss gets to choose whether they want to kick off first or choose the field. If they choose to tee off first, then the opposing team chooses the field; and vice versa. This method of tossing a coin is fair and ensures that the game is fair.
Teaching Objectives
Understand the basic rules of a soccer game.
To make a case for coin tossing through micro:bit.
To develop problem solving skills.
Teaching Preparation
Before you start teaching, please make sure you have prepared the following necessary materials:
Picture | Name | Number | Notes |
---|---|---|---|
joysticks:bit V2 | 1 | ||
AAA battery | 5 | Prepare Yourself | |
USB Cable | 1 | ||
micro:bit | 1 | Prepare Yourself | |
PC | 1 | Prepare Yourself |
These materials will provide you with a complete experience and ensure that you can follow through and learn smoothly. If you are ready for the above, we can move on to the next step.
Programming
Programming Platforms
We usually use graphical programming platform makecode to program micro:bit
Programming platform entry: https://makecode.microbit.org/
Flip a coin
Open https://makecode.microbit.org/
New Project
Enter a project name and click Create.
Write a program
Sample Program:https://makecode.microbit.org/_4hmLq8KzgJEU
You can also download the program directly from the following web page.
From the Micro:bit Simulator area we can see the simulation of the program.
How do I download the program to micro:bit?
Use a USB cable to connect your PC to the micro:bit V2.
After a successful connection, a disk drive named MICROBIT
is recognized on the computer.
Click on the bottom left corner of the,Select Connect Device
.
Click。
Click。
Select BBC micro:bit CMSIS-DAP
in the pop-up window and then select Connect, and at this point, our micro:bit has connected successfully.
Click to download the program.
Results
After shaking the micro:bit, random yes
or happy
icons are displayed on the micro:bit's LED matrix.