summaryrefslogtreecommitdiff
path: root/water_the_plant
diff options
context:
space:
mode:
authorRobert Scheibe <rob.scheibe@gmail.com>2024-12-22 15:52:40 +0100
committerRobert Scheibe <rob.scheibe@gmail.com>2024-12-22 15:52:40 +0100
commitbd0a388682dae9da9146a9d37ebfd4d2c2527b6e (patch)
tree6a555b1347dbfab3a956a4b6ede508c1559628b5 /water_the_plant
parent44a4a65f8c7244244d9b9102193d682ba89d3048 (diff)
added history.html and cpu temperature plotting
Diffstat (limited to 'water_the_plant')
-rwxr-xr-xwater_the_plant22
1 files changed, 22 insertions, 0 deletions
diff --git a/water_the_plant b/water_the_plant
new file mode 100755
index 0000000..bdfed4d
--- /dev/null
+++ b/water_the_plant
@@ -0,0 +1,22 @@
+#!/usr/bin/python3
+import RPi.GPIO as GPIO
+import time
+
+# GPIO-Modus auf BCM setzen
+GPIO.setmode(GPIO.BCM)
+
+# GPIO4 als Ausgang konfigurieren
+GPIO.setup(4, GPIO.OUT)
+
+try:
+ # GPIO4 einschalten
+ GPIO.output(4, GPIO.LOW)
+ # 1 Sekunde warten
+ time.sleep(4)
+ # GPIO4 ausschalten
+ GPIO.output(4, GPIO.HIGH)
+finally:
+ # Ressourcen freigeben
+ GPIO.cleanup()
+
+