Read pre-determined set of numbers

I would like to be able to write a pre-determined set of numbers as a joystick input over time. how would i go about doing this?

I would store them in an array and then index into different elements of the array using the elapsed time.

You can see an example of how to do this in the default Autonomous code. The motor powers are stored in an array (“Straight Power” and “Y Power”) and then elapsed time in seconds is used as an index.