I have the code in a ValueChanged Event Handler. It seems to me this should work but it doesn’t. Even at a MinimumValue of 5, the Timer moves way too fast. Any help would be greatly appreciated.
Yes, I found that out as well. To make it fire more evenly, you can put this in the ValueChanged Event:
Var maxValue As Integer = Slider2.MaximumValue
Var sliderValue As Integer = maxValue - Slider2.Value
Var minPeriod As Double = 200 // Fastest speed (200 ms per word = 300 WPM)
Var maxPeriod As Double = 2000 // Slowest speed (2000 ms per word = 30 WPM)
Var factor As Double = Exp(Log(sliderValue / maxValue) * 2)
Var period As Double = minPeriod * (1 - factor) + maxPeriod * factor
Var wordsPerMinute As Integer = 60000 / period
Timer1.Period = period