I have the following code which will start after clicking the \'Start\' button in PyQt:
def Start(self):
import time
import os
import RPi.GPIO as GPIO
There is no need to do anything other than what I suggested in your other question on this topic: just use processEvents
. As long as you can call it frequently enough (but not too frequently), it should do exactly what you want. Using your second example, the following works fine for me:
def Start(self):
if not self.started:
self.started = True
self.StartLoop()
def Stop(self):
if self.started:
self.started = False
def StartLoop(self):
DEBUG = 1
while self.started:
print "LED on "
time.sleep(0.05)
print "LED off "
time.sleep(0.085)
QtGui.qApp.processEvents()