Created
February 18, 2016 16:48
-
-
Save thisMagpie/aac9af3c350c1ad5320e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from webiopi.devices.sensor import DS18S20 | |
import datetime | |
import pylab | |
import math | |
# sensors found with "ls /sys/bus/w1/devices/" | |
tmp0 = DS18S20(slave="10-000802de0ee7") | |
tmp1 = DS18S20(slave="10-000802de4b20") | |
N = 50 | |
y0 = [0.0]*N | |
y1 = [0.0]*N | |
err = [0.0]*N | |
for i in range(N): | |
y0[i] = tmp0.getCelsius() | |
y1[i] = tmp1.getCelsius() | |
err[i] = math.sqrt((1.0/N) * math.pow((y0[i] - y1[i]), 2)) | |
pylab.xlim(y0[0] - 0.5,y0[0] + .5) | |
pylab.plot(y0, err,'bo') | |
pylab.xlabel('Temperature C') | |
pylab.ylabel('Temperature C rms error') | |
pylab.title('Temp rms error vs Temperature') | |
pylab.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment