Just like The Great Sunflower Project, we are going to create a project prototype that can also track bees and other pollinators.

  • Building
  • Coding

In the next section, you will follow step-by-step building instructions to complete your project. This project will use the same smart comments from lesson one, just in a different way.

A 3D rendering of an educational robotic setup observing a flowerbed. On the left, a sensor mounted on a vertical stand hovers over pink flowers with green foliage in a wooden planter. On the right, a robotic arm equipped with a LED and micro:bit controller is angled towards the plants, presumably to interact with or monitor them. The entire assembly is positioned on a grid-like green baseplate, suggesting a modular design for educational purposes.
Bug Counter

This is an image of the project you are going to build! You can use a real plant or use your creative muscles to make a plant!

With the help of a Makecode tutorial, you will code your project to track the number of bug visits and display them. Within the tutorial, you will be given a starter code to help you along on your coding journey.

Description
We start by setting a variable called ‘bugVisits’ to 0. This keeps track of how many times bugs visit. When the ‘Touch’ button is pressed, we add 1 to ‘bugVisits’. We also make the LEDs light up in a color, show the number of ‘bugVisits’ on the micro:bit’s LEDs, and then turn the LEDs back to black.

We give you some starting code, and your job is to add two parts:

  1. A block to add 1 to ‘bugVisits’ when ‘Touch’ is pressed.
  2. A block to show the number of ‘bugVisits’ on the LEDs.