def dataSensing(self): f = open("./nowdata.txt", 'w') self.nowData['lux'] = sensing.getLux() self.nowData['waterLv'] = sensing.getWaterLv() self.nowData['ph'] = sensing.getPh() self.nowData['temp'] = sensing.getTemp() self.nowData['hum'] = sensing.getHum() data = "%d temp, %d hum, %d lux" % (sensing.getTemp(), sensing.getHum(), sensing.getLux()) f.write(data) f.close()
def dataSensing(self): f = open("./nowdata.txt", 'w') self.nowData['lux'] = sensing.getLux() self.nowData['waterLv'] = sensing.getWaterLv() self.nowData['ph'] = sensing.getPh() self.nowData['temp'] = sensing.getTemp() self.nowData['hum'] = sensing.getHum() f.close()
def dataUpdate(): global nowdata i = 0 f = open("./nowdata.txt", 'w') nowdata['lux'] = sensing.getLux() nowdata['waterLv'] = sensing.getWaterLv() nowdata['ph'] = sensing.getPh() nowdata['temp'] = sensing.getTemp() nowdata['hum'] = sensing.getHum() while (i < numModule): f.write("%f\n" % nowdata[i]) i += 1 f.close()