In this project, you work in MakeCode to make your own electronic game. You use an accelerometer sensor to wait for a shaking motion. When the shake event happens, the micro:bit runs some code and sends some information by radio waves to another nearby micro:bit.
You can follow the directions for this project exactly to play the game on a computer — or you can make real gadgets for playing this Card War game. Or make a different type of game or gadget, one that does something else with a sensor and the radio. The accelerometer can tell whether the micro:bit board is shaken, lifted, dropped, or turned! What about an emoji alarm that shows a happy face when it’s at rest but a sad face when it’s moved? Remember, the radio sends the state of one micro:bit to a different micro:bit — friends receive each other’s emojis. How about using the magnetometer sensor, which works like a compass, to read which way the micro:bit is pointed? You can use the magnetometer and radio communication to see what direction a buddy is facing, and he or she can see what direction you’re facing, too. With these components, you can create an orienteering game!