Recording readings with datalogger.log()
Saves one row of named sensor readings, with a timestamp, in the micro:bit data log. Each call adds a new row, so use it in a loop to record readings over time.
Understanding Recording readings with datalogger.log() in ACARA Digital Technologies Years 7–8
What it does: Each call to datalogger.log() adds one row, so running it inside basic.forever() keeps adding rows as time passes. basic.pause(5000) waits 5000 milliseconds (5 seconds) before the loop logs the next row. datalogger.log() needs a named value made with createCV(), which pairs a column name with a reading. Just a string gives no reading to save. The first argument is the column heading. The second argument, input.temperature(), is the actual reading. The data logger adds a timestamp for each row automatically. You only supply your sensor readings. You can pass several createCV() values to one datalogger.log() call to make several columns in the same row.
Common mistakes: The object is called datalogger, not datalog. The line should start datalogger.log( so the row is saved in the micro:bit data log. The column name must be a string in quotes. It should be datalogger.createCV("tmp", so the log has a named column.
Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.
This module's key terms are also in a printable crossword (Modules 204–236) and word search (Modules 189–236).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
datalogger.log()Fill in the Blanks
Spot the Error
Student with a class code? Join your class →