PID update

Hello people on the VEX forums once again!

Thank you for all the helpful advice and criticism for the old code! We decided to keep it in “block” code but actually make it a loop, and use better variable names for more experienced coders to understand. If you see many problems other than it being a block code program, don’t be shy to say!

Thank you!

Screenshot 2022-04-03 9.40.01 AM

1 Like

The variable you call F-or-R seems to have only two options: forward and reverse. If you made it a boolean, you could name it isForward, which is actually a legal variable name and also is actually descriptive. It would also take up less data space, but that is minor compared to

  • it being a readable name
  • it being easier to remember what to put in forward and what for backward
  • only having to put if isForward (two blocks) instead of if F-or-R = 0 (three or four blocks, depending whether you count having to type 0), and
  • it actually being a legal variable name.

And of course, I still advise you to to change the name of S1-3 and L