The data logging feature is designed to store the data on the micro:bit device until you take an action to delete it. You can do this by flashing a new program to the micro:bit or by coding it to delete the log as part of your program.


Flashing the device increases wear on the micro:bit, so we have introduced two delete methods; fast and full to reduce the number of times you need to flash the device. In all cases, the micro:bit will disconnect and reconnect to the computer to let the computer know that the data log has been updated. 


Using the 'fast' delete method

A 'fast' erase process marks the MY_DATA log file as empty, so the data will not show on the page when loaded in the browser. It is the quickest way to delete the log and is designed so that you can start collecting new data. 


Deleting the data log by flashing a new program to the micro:bit

A 'fast' delete happens when you flash a new program to the micro:bit via USB.


However, whilst the log appears empty, the log data has just been invalidated, meaning that the micro:bit and the MY_DATA page ignore it. It is still stored within the file.



Using the 'full' delete method

A 'full' delete will remove all the data from the MY_DATA log file. This will take longer but is more secure as the data log will not persist on the MICROBIT device once the 'full' delete commenad has run. If you are sharing micro:bits with multiple people, you may want to use a 'full' delete after you complete a data logging activity or lesson. 


A 'full' delete can only be performed as part of your program.


A .hex file that performs a 'full' delete and then shows a tick/checkmark on the display is attached to this article.


Deleting the data log within your program

MakeCode

The delete log block in MakeCode lets you choose between a 'fast' and a 'full' erase, by clicking on the 'plus' sign (changes to a 'minus' sign once clicked) to show the options.



  • A 'fast' delete will invalidate the data and mark the MY_DATA log file as empty. It is the quickest way to reset the log to make the log may appear empty, however the logged data remains on the device in the MY_DATA file.

  • A 'full' erase will remove all the data from the MY_DATA file. This will take longer but is more secure as it ensures any previously logged data will not persist on the MICROBIT device.