The Pollen
There must be at least one Pollen micro:bit/player. The Pollen player(s) hide while the Bee player(s) search for them to collect pollen, which they bring to the Flowers.
To create a Pollen micro:bit, you will need:
- 1 micro:bit
- 1 battery box (and batteries)
- 1 USB programming cable
To program the micro:bit, you will also need a computer that is connected to the Internet and has a USB input.
Instructions:
On the computer, point your browser to https://makecode.microbit.org/ and select "New Project".
Name this project "Pollen".
on start Block
To set up the game, we'll use the "on start" block, which should be already on the screen.
Click "Radio" and then "more". In this menu, look for the "radio set transmit power" block.
Drag this block onto the "on start" block.
Change the number in the white text field to "0" by typing in the text field or by moving the slider. Setting the value to 0 limits the radio transmission to the lowest possible setting, which means the micro:bits will need to be within around a meter of each other to be able to communicate wirelessly.
Add an indicator that this is the Pollen player. To do this, click "Basic" in the menu and drag the "show leds" block into the "onstart" block underneath radio transmit power. Click on the appropriate grey boxes in the grid to form the letter "P".
,
Starting the Game
Now it's time to add the code that starts the game (pressing the 'A' button). Click on "Input" in the menu, and drag the "on button 'A' pressed" onto the workspace.
On the Pollen player's micro:bit, there should be a flower icon. The Pollen player's micro:bit will also send out a message of "Pollen" to the other micro:bits in the area.
To create these tasks, go to the "Loops" menu and click the "while false" block. This runs the code inside this loop continuously for the rest of the game. For more information on While loops, visit MakeCode support at https://makecode.microbit.org/blocks/loops/while
Display Flower Icon
Next, set up the Flower icon on the micro:bit's display. Click "Basic" and drag the "show icon" block into the "while false" block. Then click on the dropdown menu and select the Flower icon.
Send Pollen Message Wirelessly
The final task is to build the functionality that sends the message "Pollen" to the other micro:bits in the area.
Click the "Radio" menu and drag the "radio send string" block into the "while false" block. Click in the text field and type in "Pollen".
The completed "on button A pressed" block should look like this:
The code for Pollen is now complete. The entire program should look like this:
Don't forget to save your work! The save interface is located at the bottom of the screen.
Click the Save icon (the floppy disk) to save your work.
The coding is now complete and the final step is adding the code to a micro:bit. More details on how to do this can be found at the micro:bit Guide for Programming.
If you haven't already programmed Flower and Bee, follow the links below: