I'm writing a software in Qt/c++ that communicate through serial with arduino and other electronic devices.
I need to start a sequence of events that call different slot with different timing like this:
- Start Motor 1 For 20 seconds
- After 10 seconds Start Motor 2
- Stop Motor 1
- Change Motor 1 speed
- Start Motor 1 For 30 second
I've tried with QTimer::singleShot but it works only with slot with no parameters and I need to set parameters like motor speed different from time to time.
Right now I'm using a delay function that confront currentTime do dieTime but it is complicated to keep track of timing to all the devices.
What is the best solution in doing this? Suggestions?