Hey,
I wrote a python program that opens multiple threads (less threads than the cor can max handle, so no overload) and I defined some gpios as inputs_pullups and as outputs. The threads should use the gpios and act with them, but I get no reaction. The code works, except for the GPIO interaction. does anyone know what the problem is, had similar problems or knows how to fix it?
here is an excerpt of how the gpios are used with the trads:
import RPi.GPIO as GPIO
import threading
def led_test():
while true:
PIO.output(led_one, GPIO.HIGH)
button_state = GPIO.input(bt_pin)
if button_state == GPIO.LOW:
PIO.output(led_one, GPIO.LOW)
led_thread = threading.Thread(target=led_test)
led_one = 24
led_two = 18
bt_pin = 27
GPIO.setmode(GPIO.BCM)
GPIO.setup(bt_pin, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(led_one, GPIO.OUT)
GPIO.setup(led_two, GPIO.OUT)
PIO.output(led_two, GPIO.HIGH)
led_thread.start()