Reputation: 33
There are six LEDs that light up one after the other. I want to control the speed of the flashes with a slider. Unfortunately, after reaching station A, the value of the slider actually changes. I want if I change the slider while running, I can immediately notice the change in the flash of the LEDs. Anyone have any idea how this could be solved?
Upvotes: 1
Views: 686
Reputation: 1
Here is a more detailed explanation to the code of KKS: You need a second while loop to change the time of your slider immediately. If you keep one while loop only, the new value of the slider will be active only in the next iteration. You need to put your slider in the second while loop and this loop needs to run faster than your while loop which contains your LEDs. In order to connect the value of the slider in the fast while loop with your slow while loop, you can use local variables.
Upvotes: 0
Reputation: 1389
Based on your code,
This is an example block diagram.
The corresponding front panel is this.
Upvotes: 1