If it's not obvious, I'm trying to learn python, and am having a go at it. Although, I'm running into some issues. Any help would be appreciated.
I'm trying to run this on a Rpi3b+ & with a relay
Edit: What I'm trying to do is have the script check the water level first before the it activates the pump relay, but I can't even get the script to pass a debug run through. Or is there a better way to write this script that will work with a Rpi?
# Hydroponic Watering v.0.0.1 import RPi.GPIO as GPIO import time import sys import signal signal.signal(signal.sigint, GPIO) # Setting GPIO pins on Rpi GPIO.setmode(GPIO.BCM) signal, resv_level_pin, GPIO.in, pull_up_down = GPIO.PUD_up = 18 pump_relay, GPIO.OUT = 9 def check_water_level if resv_level_pin == true pump_relay(on) elif resv_level_pin == false pump_relay(false) print("Water level too low!") exit(sys.exit)
Debug output as follows:
Traceback (most recent call last): File "/usr/share/mu-editor/mu/mu-debug.py", line 4, in <module> from mu.app import debug ModuleNotFoundError: No module named 'mu' ---------- FINISHED ---------- exit code: 1 status: 0