MicroCode Bee Tracker


Bees play a big role in our ecosystem, helping plants reproduce and ensuring we have food to eat. However, pollinator populations are declining due to things like habitat loss and climate change. By monitoring their activity, we can learn to better protect these essential creatures.
Let’s build a bee counter that helps us track the number of bee visits to a garden!
The bee counter in this project will:
- Count bee visits (simulated by touch)
- Light up an LED when a bee lands

Prepare
You’ll need the following items to complete this project:
Build
First, let’s build your bee counter with the Climate Action Kit:
Code
- Plug your micro:bit into the top of the CodeCTRL device.
- Connect your CodeCTRL to a sensor port on breakout board.
- Turn on the breakout board.
- Turn on the CodeCTRL.

Recreate the following program in MicroCode:

Improve
Think about additional features you could add to your smart bee counter! How would you modify the sample code provided, or create your own code that includes the following features?
- Add Sound: Can you make the micro:bit play a sound when a bee lands?
- Display Temperature: The outside temperature can impact bee pollination habits. Can you display the temperature on the micro:bit’s LED display?
Feeling Stuck? Explore the Knowledge Base for common questions and troubleshooting tips.