For this project, you have two options for coding. You may download the completed code or follow a step-by-step tutorial to code from scratch:

  • Download
  • Tutorial

Explore the code below to get started with your current monitor:

  • Connect your project to the computer and download the code to make it work.
  • Review the code comments on each block to learn about how your solar project works, then try testing it in real life.

Improve

How would you modify the sample code provided, or create your own code that includes the following features?

  • Adjust Sensitivity: Change the current thresholds in the if/else if statements. How does this change the sensitivity of your display?
  • Add Sound Feedback: Make the micro:bit play a different sound effect for each level of current (e.g., a low tone for low current, a high tone for high current).
  • Display Exact Current: Add a button (e.g., on button A pressed) that, when pressed, temporarily shows the exact numerical current reading on the micro:bit’s displays.