I have a question regarding the Control Panel in terms of obtaining the data as according to the game rules, we get the color for our match from inserting the following code into our robot: https://frc-docs.readthedocs.io/en/latest/docs/software/wpilib-overview/2020-Game-Data.html. According to this document I put the code they provided into my robot’s code; however, what I do not understand is where I put this code in the robot code, would it be in the Robot class under the teleopPeriodic Method?
Also, where is the data displayed during the competition as for what color we have to rotate the control panel to?
Yes, teleopPeriodic is a good place to put it (or a function called by teleopPeriodic such as a subsystem periodic function in command-based), since this information is given to you at some point in teleoperated mode.
The information is not displayed. You have to get it using the above code. If you want it displayed to the drivers, you’ll need to display it to them (one good way to do this is to use NetworkTables and show it via a dashboard application).