A deterministic end result when timer is stop



  • i have a LED blinking red and black toggling between the two color.
    When timer stop, the LED appears to be sometimes black, sometimes red.

    I resort to cast the LED red again after timer stop, but the results is still the same.
    I thought this is because time taken to stop the timer is longer compared to the time taken to execute next instruction subsequently, thus a delay is needed

    Now sloution is using qWait and qSleep and if there is other solution.

    QTest::qSleep(100); // no event processing
    QTest::qWait(100); // event processing


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.