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.
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:
- A block to add 1 to ‘bugVisits’ when ‘Touch’ is pressed.
- A block to show the number of ‘bugVisits’ on the LEDs.