Instructions

Code for the Energy Logger (MakeCode)
The code for this project can be accessed here:
https://makecode.microbit.org/_Avq2HMMfp2gp
How it works
The code loops round once per second and takes a reading from the P0 pin. This
reading is sent via the serial port, which transfers the data over the USB lead to
your computer. A reading will be somewhere between 0 (for 0V) and 1023 (for 3V),
and the voltage at the P0 pin will change as the amount of stored charge changes.
Button A and Button B are used to turn the output stage of the Solar Store off and
on respectively, so that you can switch between charging and discharging. While
you are doing this, you are capturing a history trace of the amount of energy stored
in the Solar Store.
You can use this information to work out how quickly the Solar Store charges and
discharges in specific light conditions, and this information will be vital later to
correctly configure the final intelligent project.
Page 23