def run(self): my_Ard.clear_buffer() while True: packet = my_Ard.listen() #packet is in dict format #queueLock.acquire() if packet is not None: #check if queue is full. If full, dont put it inside queue #print("data into queue: " + str(packet)) dataQueue.put(packet)
def run(self): my_Ard.init() while True: packet = my_Ard.listen() #packet is in dict format queueLock.acquire() if not dataQueue.full( ): #check if queue is full. If full, dont put it inside queue #print("data into queue: " + str(packet)) dataQueue.put(packet) queueLock.release()
from arduino import listen, init import time print("Welcome to debug mode!") init() while True: packet = listen() if packet is not None: print(packet)