Why use PROS::Delay

Hey all, this may be a silly question but I was looking through old code and I saw that some seniors that have since departed used pros::delay(50) after certain actions. I know that pros::delay delays an action for a set number of milliseconds, but I don’t know when and why someone would choose to it. Could someone please help me on this? Thanks in advance!

Assuming you are asking “why do we have a delay statement in the first place?”
PID, motion profiling, pure pursuit, position tracking with respect to time, calculating speed with respect to time, attempting a different autonomous functions if there is no callback of completion of an action after a set period of time, coding transitions/animations on the V5 brain menu, sensor calibration every x seconds during pre-auton period, etc.

1 Like