-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemperature_monitor
More file actions
executable file
·45 lines (39 loc) · 1.36 KB
/
temperature_monitor
File metadata and controls
executable file
·45 lines (39 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#! /usr/bin/env python
# -*- mode: python; encoding: utf-8 -*-
#
# A test script to drive the mcc support module
#
# This script was developed by:
# Rattlesnake Hill Technologies Inc. <chuck@rattlesnake-hill.com>
# for:
# The TESS project at the MIT Kalvi Institute for Astrophysics and
# Space Research
#
# The MIT Kalvi Institute for Astrophysics and Space Research has ownership
# of this code, and will establish the licensing terms.
from __future__ import print_function
if __name__ == '__main__':
import mcc
import time
devices = mcc.find_devices()
number_of_channels = 8
for d in devices:
d.calibrate()
for d in devices:
d.blink()
# Print the header
print("Sample #, Serial #, Sample Time, {Channels}".format(
Channels=", ".join("Ch{}".format(i) for i in range(0, number_of_channels))))
sample_number = 0
while True:
sample_time = time.time() * 1000
sample_number += 1
for d in devices:
temperatures = d.scan_channel_temperatures()
# Print the sample data
print("{sample_number}, {serial_number}, {sample_time}, {temps}".format(
sample_number=sample_number,
serial_number=d.serial_number,
sample_time=sample_time,
temps=", ".join(map(str, temperatures))))
time.sleep(2)