When your code runs in space, you won't be there to watch the screen. You need to record everything that happens to a file so you can analyze it later.
We need to create a reliable data logger that records the temperature and humidity at regular intervals. This data is crucial for the experiment analysis.
Objective: Continuously record environmental data to a log file.
Instructions:
for loop that runs 5 times.sense.get_temperature() and sense.get_humidity().logger.info() to save this string to the log file.time.sleep(1) delay.Robust and easy-to-use logging for Python.
| Usage | Description |
|---|---|
| logfile("file.log") | Set the file to write logs to. |
| logger.info(msg) | Log an informational message. |
| logger.warning(msg) | Log a warning message. |
| logger.error(msg) | Log an error message. |
Controls the LED matrix and reads environmental sensors.
| Usage | Description |
|---|---|
| sense.get_temperature() | Get temperature in Celsius. |
| sense.get_humidity() | Get relative humidity (%). |