use arrays for storing measures

master
ademant 2019-05-27 05:55:16 +02:00
parent 520529e426
commit 78a8a6739a
1 changed files with 3 additions and 2 deletions

5
tri.py
View File

@ -1,6 +1,7 @@
#!/usr/bin/env python
import time
import numpy as np
a = 2
# import the server implementation
@ -27,7 +28,7 @@ GAIN = 1
channel_names=["time","CPU_temp","a0_0","a0_1","a0_2","a0_3","a1_0","a1_1","a1_2","a1_3","volt_scale","amp_scale",
"volt_batt_term","volt_batt_sense","volt_array","current_batt","current_array","temp_heatsink","temp_batt","ah_reset",
"ah_total","kwh_reset","kwh_total","power_in","power_out","hour_total","state","volt_sweep_mp","volt_sweep_oc"]
ch_val=0*len(channel_names)
ch_val=np.zeros(len(channel_names))
ch_old=ch_val
while a > 1:
@ -36,7 +37,7 @@ while a > 1:
tempC=0
tFile = open('/sys/class/thermal/thermal_zone0/temp')
temp = float(tFile.read())
ch_val[channel_names.index("CPU_temp")] = float(tFile.read())
tFile.close()
timefile=round(timestamp/3600)