This is a Treasure Hunt game that is designed to teach students how to use the Radio functions of the MicroBit, with one Bit sending a signal, and the other receiving it. Before making anything, I try to come up with an 'I Want' statement, and I try to make it specific. If it is clear, its makes it easy to create the program.
Treasure Hunt
Description: The Treasure Hunt game consists of two groups. One group is a set of treasure hunters, the other is a group of treasure hiders. The treasure hiders will hide a treasure somewhere, and will then post a series of MicroBits as sign posts. The treasure hunters will approach a signpost signal it for information. When it is received, they will proceed to the next sign post. The game is over when the treasure hunters find the treasure.
Treasure Hunters: The treasure hunters have Microbits that can signal a Sign Post for directions. They will press a button, and see what the signpost tells them.
I want: The MicroBit will be in a rest state, and it will be on a radio channel. When the ‘A’ button is pressed it will send a variable. The SignPost will receive the variable, and display the direction and number of paces. Then it will go back to a rest state.
Code for Treasure Hunters:
Sign Post: The sign posts are meant to be little stations that will let the treasure seeker know how far, and in what direction they should go to find the next signpost or the treasure.
I want: The MicroBit will be in a rest state, and it will be listening on a radio channel. When it receives a variable, it will show an arrow pointing in some direction. Then it will pause for three seconds, and display the number of paces to the next signpost or treasure. It will pause for three seconds, and then go back to a ‘rest’ state, where a diamond is shown.
Block Code for a Sign Post