Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1datalogger.log(datalogger.createCV("temperature", input.temperature())) | ASaves one new row in the data log with a column called temperature holding the current temperature reading | |
| 2datalogger.log(datalogger.createCV("temp", input.temperature()), datalogger.createCV("light", input.lightLevel())) | Bbasic.forever(function () { datalogger.log(datalogger.createCV("temperature", input.temperature())) basic.pause(5000) }) | |
| 3To record readings over time, put datalogger.log() inside a loop so each pass adds a new row to the log | Cbasic.forever(function () { datalogger.log(datalogger.createCV("temperature", input.temperature())) }) | |
| 4Pausing between logs spaces the readings out, for example one row every 5 seconds | DSaves one row with two columns, temp and light, so two readings are recorded together at the same moment | |
| 5datalogger.log("temperature", input.temperature()) | EThe reading is not wrapped in datalogger.createCV(), so the column name and value are not paired properly for the log. | |
| 6datalogger.log(datalogger.createCV("temperature", input.temperature)) | Finput.temperature is missing its brackets (), so the function is never called and no reading is taken. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
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.datalogger.log(
datalogger.createCV("temperature",
input.temperature()))datalogger.log(
datalogger.createCV("temperature",
input.temperature()))basic.forever(() => datalogger.log(
datalogger.createCV("temperature",
input.temperature())))datalogger.log(
datalogger.createCV("l", input.lightLevel()),
datalogger.createCV("s", input.soundLevel()))datalogger.log(
datalogger.createCV("temperature",
input.temperature()))