devilz Posted September 22, 2018 at 06:34 PM Share Posted September 22, 2018 at 06:34 PM Hallo zusammen, ich versuche grade die Wetterstation mit dem OutdoorWeather Modul zu erweitern. Leider bekomme ich die Werte aus der cb_station_data/cb_sensor_data Callback nicht in die Button_Callbackfunktion. def cb_station_data(self, identifier, temperature, humidity, battery_low): print("Identifier (Station): " + str(identifier)) print("Temperature (Station): " + str(temperature/10.0) + " °C") print("Humidity (Station): " + str(humidity) + " %RH") print("Battery Low (Station): " + str(battery_low)) print("") def cb_sensor_data(self, identifier, temperature, humidity): print("Identifier (Sensor): " + str(identifier)) print("Temperature (Sensor): " + str(temperature/10.0) + " °C") print("Humidity (Sensor): " + str(humidity) + " %RH") print("") def cb_button_pressed(self, button): lt = localtime() date = (strftime(" %d %b %Y %H:%M", lt)) if button == 2: if self.lcd.is_backlight_on(): self.lcd.backlight_off() else: self.lcd.backlight_on() if button == 3: self.lcd.write_line(0, 0, date) self.lcd.write_line(1, 0, " *** Sensor1 ***") self.lcd.write_line(2, 0, "Temperatur: ...") self.lcd.write_line(3, 0, "Feuchtigkeit ...") Gibt es hier eine Möglichkeit die Werte aus den beiden Callbacks oben in die Button Callbackfunktion zu übernehmen? Wie kann ich die Sensorwerte gezielt in eine Variable speichern? Danke für jeden Tipp Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.