What to expect
Welcome to SUPERCHARGE! During this activity, you will get to hold, code, and familiarize yourself with the micro:bit and your fellow SUPERCHARGErs by competing against one another in an electronic Rock, Paper, Scissors tournament.
Connections
This activity will be an introduction to the micro:bit device. The micro:bit is a pocket-sized computer that will show you how software, hardware, and computer programming all work together. You’ll be using and learning to love your micro:bit for the rest of the year!
Materials
Laptop or Computer
USB to Micro USB cable
micro:bit Board and access to MakeCode Website
Access to Rock Paper Scissors MakeCode
Instructions
In this activity, we will start to get familiar with the micro:bit computer. A micro:bit is a small computer called a microcomputer. Microcomputers are small and inexpensive, but mighty! They can do many of the same things that a full-size computer can do. In this activity we will use the MakeCode website to transfer some pre-written computer code to your micro:bit device. The pre-written code will allow you to play Rock, Paper, Scissors with your micro:bit and compete against your classmates. After you download the code to your micro:bit, test it with the directions below. Then, you should go around the room and battle your fellow Superchargers at Rock, Paper, Scissors. Who will be the Rock, Paper, Scissors champion?
Get Ready for Rock, Paper, Scissors
Connect your micro:bit to your computer with the micro USB to USB cable
2. Select the Rock Paper Scissors MakeCode hyperlink and press Edit or Edit Code to open
3. You will need to pair your micro:bit in the MakeCode window. First, press the "..." symbol with 3 dots next to the Download button at the bottom left of the screen.
4. Next, select the “Connect device” button from the pop-up window
5. In the next two boxes that pop up select "NEXT" then "Pair"
6. Finally, click the compatible micro:bit device in the last pop-up menu
7. To download your code from the MakeCode website to your micro:bit press download. Select "Next", press "Save" and "Done".
8. Locate your computer’s version of a File Explorer. Check that your micro:bit is showing up as a location similar to the “MICROBIT(D:)” option shown above. If not, check the connection between your micro:bit and computer.
9. Next, go into your Downloads folder and see that the Rock, Paper, Scissors code has been downloaded.
10. If you don't see it, go back to the edit window and make sure you pressed save.
11. Click and drag the file from the downloads folder to the MICROBIT(D:) location to transfer the code between your device and micro:bit.
12. Shake your micro:bit to check that the code has been successfully downloaded.
13. FInd someone to battle with!
Rock Paper Scissors Battles
Every time you shake the micro:bit, it will display an image: rock, paper, or scissors.
Paper beats Rock
Rock beats Scissors
Scissors beats Paper
Anything against itself is a draw
Think About It
An accelerometer is a device that measures the motion, including vibrations, of an object. The micro:bit has a built-in accelerometer. When the micro:bit accelerometer detects a shake movement, it sets a variable in the code to a random number: 0, 1 or 2. This random number tells the micro:bit whether to display a rock, paper, or scissors.
Did the program work as expected? Why or why not?
Can you think of a way that you could edit this Rock, Paper, Scissors program to add another cool feature?
Take another look at the program code for the Rock, Paper, Scissors program. What if you wanted to add a fourth option besides Rock, Paper, and Scissors (how about Water, or Tree, or Snake)? What would you need to change in the code to add a fourth option? (note that the “Play Sound” blocks are not critical to the code performing correctly and can be ignored for this question)
Feedback Link
How did you feel about this activity? Change the emoji to show your feelings.