removed some ai garbage, moved json output to new json folder.
!!! temperaturSensor.py is incompatible with the webserver !!! !!! fix asap !!!
This commit is contained in:
parent
3226ed29ec
commit
9bf8f089b6
6 changed files with 9 additions and 15 deletions
|
@ -33,12 +33,9 @@ def save_data(data):
|
|||
def capture_and_store():
|
||||
state = GPIO.input(SENSOR_PIN)
|
||||
timestamp = int(time.time()) # Unix-Zeitstempel (int)
|
||||
noise = 1 if state == 0 else 0
|
||||
noise = True if state == 0 else False
|
||||
|
||||
entry = {
|
||||
"ts": timestamp,
|
||||
"value": noise
|
||||
}
|
||||
entry = { "ts": timestamp, "value": noise}
|
||||
|
||||
data = load_data()
|
||||
data["readings"].append(entry)
|
||||
|
@ -56,4 +53,4 @@ if __name__ == "__main__":
|
|||
except KeyboardInterrupt:
|
||||
print("Stopped by user.")
|
||||
finally:
|
||||
GPIO.cleanup()
|
||||
GPIO.cleanup()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue