tm3d
/
owSlave2.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
New Dual with BMP280 and SHT
[owSlave2.git]
/
DS18B20_Thermocouble
/
convthermocouple.py
1
fi=open("Typ-J.csv","r")
2
lastv=0
3
v=0
4
lastt=0
5
t=0
6
rs=""
7
wc=0
8
for l in fi.readlines():
9
#print(l)
10
ll=l.split(";")
11
i=0
12
for n in ll[1:10]:
13
s=ll[0]+"."+str(i)
14
lastv=v
15
lastt=t
16
v=float(n)
17
t=float(s)
18
if (int(v)!=int(lastv)):
19
interp=lastt+(t-lastt)/(v-lastv)*(int(v)-lastv)
20
print int(v),interp
21
rs=rs+", %f" %(interp)
22
wc=wc+1
23
if (v==0):
24
interp=lastt+(t-lastt)/(v-lastv)*(int(v)-lastv)
25
print int(v),interp
26
rs="{0"
27
wc=1
28
29
i=i+1
30
print rs+"};"
31
print wc