This file manages adding collected temperature data to the csv. More...
Variables | |
| Lab_04_Main.stm_temp = pyb.ADCAll(12 , 0x70000) | |
| Variable representing Nucleo temperature pin. | |
| int | Lab_04_Main.interval = 60000 |
| Variable representing the interval between temp recordings in milliseconds. | |
| Lab_04_Main.start_time = utime.ticks_ms() | |
| Variable representing the initial time used for zeroing. | |
| int | Lab_04_Main.next_time = start_time + interval |
| Variable representing the next time that loop should run. | |
| int | Lab_04_Main.total_time = 28800000 |
| Variable representing the total length of data collection in milliseconds. | |
| int | Lab_04_Main.points = 0 |
| Variable tracking the number of data points collected. | |
| Lab_04_Main.mcp = mcp9808(24) | |
| Define the temperature sensor object. | |
| Lab_04_Main.current_time = utime.ticks_ms() | |
| Variable representing the current time. | |
| Lab_04_Main.time = str(current_time - start_time) | |
| Zeroed current time to be added to data file. | |
| Lab_04_Main.STM_Temp = str(stm_temp.read_core_temp()) | |
| Current Nucleo temprature reading to be added to data file. | |
| Lab_04_Main.MCP_Temp = str(mcp.celsius()) | |
| Current MCP9808 temperature reading to add to data file. | |
This file manages adding collected temperature data to the csv.
This file first imports the mcp9808 temperature sensor driver which it initializes with the correct address. Time variables are then set up to allow a while loop to collect data at a desired rate over a desired period of time. The current definitions will collect data every minute for eight hours. Using the with loop the desired csv file is opened, and the while loop runs until eight hours of data from both the mcp9808 and on board temperature sensor have been added.