In my application, I am trying to toggle the LED lights for a predefined time like 30 seconds. For that, I am using a while loop and it must break once the time.time() function reaches predefined values irrespective of any key press, but my while loop stays on even though time.time() reaches a predefined time. The reason is code stays at first event.waitKeys() for an infinite amount of time. I got to know it is possible to define the waiting time. so,
I am curious to know the minimum value I can give for maxWait in event.waitKeys() function?
while ((time.time() < Mytimer)): if myChannel == '1': if u'i' in event.waitKeys(maxWait = 1,): command = arduino.write(struct.pack(u'>H',513)) myTime = myTime - 1 instruction1.draw() win.flip() if u'e' in event.waitKeys(maxWait = 1,): command = arduino.write(struct.pack(u'>H',512)) myTime = myTime - 1 instruction2.draw() win.flip()