git-svn-id: http://moon:8086/svn/projects/HendiControl@191 fda53097-d464-4ada-af97-ba876c37ca34
27 lines
591 B
Python
27 lines
591 B
Python
import time
|
|
import numpy as np
|
|
from max31865 import Max31865
|
|
from matplotlib.pyplot import figure, clf, plot, xlabel, ylabel, xlim, ylim, title, grid, axes, show, subplot
|
|
|
|
|
|
class TempLogger():
|
|
def __init__(self):
|
|
self.sensor = Max31865()
|
|
self.temps = np.empty(0)
|
|
|
|
def run(self, dt, duration):
|
|
|
|
for t in range(0, duration):
|
|
temp = self.sensor.getTemperature()
|
|
print ("Current temperature is {:0.2f} °C".format(temp))
|
|
self.temps = np.append(self.temps, temp)
|
|
time.sleep(dt)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
logger = TempLogger()
|
|
logger.run(1, 10)
|
|
|
|
print("End of program")
|
|
|