2019-09-23, 07:45 PM
If I make all config edits for the 1-wire ds2482 in the MCS-App, is it possible that your 1-wire app Handle the Sensor too?
Or should I make an own 1-wire handle in the MCS app?
The code after config
Or should I make an own 1-wire handle in the MCS app?
The code after config
Code:
import os
x= os.listdir("/sys/bus/w1/devices")
x.remove ("w1_bus_master1")
sensor_data=""
for i in x:
foo = open("/sys/bus/w1/devices/"+ i +"/w1_slave","r")
data = foo.read ()
foo.close()
spos=data.find("t=")
tempx=(data[spos+2:-1])
temp = int(tempx)/1000
sensor_data +=i + ";" + str(temp) +","
sensor_data=sensor_data.split(",")
for i in sensor_data:
print (i)