PROS V5 how to initiate motor/controller?

for pros v5 C++, how can I initiate motor/controller for both autonomous and driver-control? where should I put the following code to initiate motor/controller? I know I can put them in the opcontrol.cpp. However I want the autonomous to use the same configuration as well.

pros::Controller master(pros::E_CONTROLLER_MASTER);
pros::Motor liftleft (5);
pros::Motor liftright (6, true);


If you can read Chinese, you can refer to this. All set to pointers. In initialize (), use “new” to create a new class.

1 Like

(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)