so langsam habe ich den Überblick verloren

:K
Code: Alles auswählen
def main():
global globalCounter
tmp = 0 # Rotary Temperary
queue = Queue()
queue2 = Queue()
mess_thread = threading.Thread(target=mess_loop_RE, args=(queue,queue2, ))
schreib_thread = threading.Thread(target=write_to_file, args=(queue,))
senden_thread = threading.Thread(target=send_to_platform, args=(queue2,))
mess_thread.start()
schreib_thread.start()
senden_thread.start()
while True:
rotaryDeal()
if tmp != globalCounter:
print ('globalCounter = %d' % globalCounter)
print(GPIO.input(16))
print(GPIO.input(18))
print(GPIO.input(22))
tmp = globalCounter
Code: Alles auswählen
def rotaryDeal():
global flag
global Last_RoB_Status
global Current_RoB_Status
global globalCounter
Last_RoB_Status = GPIO.input(RoBPin)
while(not GPIO.input(RoAPin)):
Current_RoB_Status = GPIO.input(RoBPin)
flag = 1
if flag == 1:
flag = 0
if (Last_RoB_Status == 0) and (Current_RoB_Status == 1):
globalCounter = globalCounter - 1
if (Last_RoB_Status == 1) and (Current_RoB_Status == 0):
globalCounter = globalCounter + 1