Hello All,
I am trying an basic IoT project: Raspberry Pi 3 + Two Ds1820 temperature sensors: I set up the Raspberry PI with the NOODS and its working.
I can read the temperature for the sensors; I have a python program to read the temp automatically.
The problem, the error messages keep pop up when I run the module.
Any idea? any ready program for this project to go with for now?
Thank You
this is my code
import os
import time
import smtplib
DS18B20_1="/sys/bus/w1/devices/28-00000923F159/W1_slave"
DS18B20_2="/sys/bus/w1/devices/28-00000923dab2/w1_slave"
counter1= 1
counter2= 1
print ("Welcome" )
while True:
first=open(DS18B20_1,"r")
data1-first.read()
first.close()
second=open(DS18B20_2,"r")
data2=second.read()
second.close()
(discard,sep,reading1)=data1.partition('t=')
(discard,sep,reading2)=data2.partition('t=')
temp1=float (reading1)/1000
temp2=float (reading2)/1000
round1=int(temp1)
round2=int(temp2)
counter1+1
counter2=1
print(str(counter1)+" return ="+str(round1)+" *C")
print(str(counter2)+" supply ="+str(round2)+" *C")
I am trying an basic IoT project: Raspberry Pi 3 + Two Ds1820 temperature sensors: I set up the Raspberry PI with the NOODS and its working.
I can read the temperature for the sensors; I have a python program to read the temp automatically.
The problem, the error messages keep pop up when I run the module.
Any idea? any ready program for this project to go with for now?
Thank You
this is my code
import os
import time
import smtplib
DS18B20_1="/sys/bus/w1/devices/28-00000923F159/W1_slave"
DS18B20_2="/sys/bus/w1/devices/28-00000923dab2/w1_slave"
counter1= 1
counter2= 1
print ("Welcome" )
while True:
first=open(DS18B20_1,"r")
data1-first.read()
first.close()
second=open(DS18B20_2,"r")
data2=second.read()
second.close()
(discard,sep,reading1)=data1.partition('t=')
(discard,sep,reading2)=data2.partition('t=')
temp1=float (reading1)/1000
temp2=float (reading2)/1000
round1=int(temp1)
round2=int(temp2)
counter1+1
counter2=1
print(str(counter1)+" return ="+str(round1)+" *C")
print(str(counter2)+" supply ="+str(round2)+" *C")