This program is supposed to recognize an input voltage of 5V and then proceed to start the vertical bar picture box moving either left or right, per the users choice. The user can also input the desired bar width, scroll speed, and cycle duration (time to get from left to right and back). I want the picture box to move left and right repeately and smoothly. On frame #3, I created what I believe to be a state machine. The outer while loop should obtain the resulting position value from the inner while loop and then use that value as the new starting position. For some reason, the picture box will start moving left (if "Left" is chosen as the initial direction) and then remain on the left while shaking. It should rather move from the left back to the right and back left again. How do I fix this problem?
Thank you!!
(the first attachment is with the state machine.
the second has the same problem as the first but has a less complicated format)