Controlling Speed with a Slider
Now that the interface includes a precise way to turn the robot, it was time to devise a way for the user to precisely control the speed of the robot. After some thought, I came to the conclusion that a slider would be ideal. Again, having no prior background in C#, I had to investigate how to first add a slider to my interface and then correctly code it. Similar to the spinner box, the slider also needed a minimum and maximum value. Learning my lesson from the spinner box, I checked the properties box of the slider before proceeding to the code. As it turns out, I was able to set the minimum and maximum value from the properties panel. The next issue with the slider was determining the jump interval. Initially, I had the slider jump by values of 10. However, when I tried to use the slider to control the speed, I felt I was very limited in my choices. As such, I changed the increment property of the slider to 1. This gives the user very fined tuned control over the speed of the motor. Even though there were a few bumps in the road, and some problems to overcome, I feel my progression in creating the interface is going very well.
Â