V5 Tower Takeover Display

Here is my code for a V5 display for this years game. It includes an image of the field and a status for whether the controller is connected to field control or not. I used Robot Mesh Studios Mimic feature to check everythings positioning so im not sure if it looks different on an actual Brain.
P.S. It has to be put into a Competiton template to work


int main() {    
//Comp Control Status
    Brain.Screen.setPenWidth(10);
    if (Competition.isFieldControl()) {
        Brain.Screen.setPenColor(color::yellow);
    Brain.Screen.drawCircle(355, 120, 110, color::green);
    Brain.Screen.setFillColor(color::green);
    Brain.Screen.printAt(307, 120, "Connected");
    Brain.Screen.printAt(314, 140, "to Field");
  } else {
    Brain.Screen.drawCircle(355, 120, 110, color::red);
    Brain.Screen.setFillColor(color::red);
    Brain.Screen.printAt(292, 120, "Not Connected");
    Brain.Screen.printAt(312, 140, "to Field");
  }
   //Value Set
   Brain.Screen.setPenWidth(1);
   Brain.Screen.setPenColor(color::white);
   Brain.Screen.setFillColor(color::black);
   //R1
   Brain.Screen.drawRectangle(0, 190, 40, 40, color::black);
   Brain.Screen.drawRectangle(0, 152, 40, 40, color::black);
   Brain.Screen.drawRectangle(0, 114, 40, 40, color::black);
   Brain.Screen.drawRectangle(0, 76, 40, 40, color::black);
   Brain.Screen.drawRectangle(0, 38, 40, 40, color::red);
   Brain.Screen.drawRectangle(0, 0, 40, 40, color::black);
   //R2
   Brain.Screen.drawRectangle(38, 190, 40, 40, color::black);
   Brain.Screen.drawRectangle(38, 152, 40, 40, color::black);
   Brain.Screen.drawRectangle(38, 114, 40, 40, color::black);
   Brain.Screen.drawRectangle(38, 76, 40, 40, color::black);
   Brain.Screen.drawRectangle(38, 38, 40, 40, color::black);
   Brain.Screen.drawRectangle(38, 0, 40, 40, color::red);
   //R3
   Brain.Screen.drawRectangle(76, 190, 40, 40, color::black);
   Brain.Screen.drawRectangle(76, 152, 40, 40, color::black);
   Brain.Screen.drawRectangle(76, 114, 40, 40, color::black);
   Brain.Screen.drawRectangle(76, 76, 40, 40, color::black);
   Brain.Screen.drawRectangle(76, 38, 40, 40, color::black);
   Brain.Screen.drawRectangle(76, 0, 40, 40, color::black);
   //R4
   Brain.Screen.drawRectangle(114, 190, 40, 40, color::black);
   Brain.Screen.drawRectangle(114, 152, 40, 40, color::black);
   Brain.Screen.drawRectangle(114, 114, 40, 40, color::black);
   Brain.Screen.drawRectangle(114, 76, 40, 40, color::black);
   Brain.Screen.drawRectangle(114, 38, 40, 40, color::black);
   Brain.Screen.drawRectangle(114, 0, 40, 40, color::black);
   //R5
   Brain.Screen.drawRectangle(152, 190, 40, 40, color::black);
   Brain.Screen.drawRectangle(152, 152, 40, 40, color::black);
   Brain.Screen.drawRectangle(152, 114, 40, 40, color::black);
   Brain.Screen.drawRectangle(152, 76, 40, 40, color::black);
   Brain.Screen.drawRectangle(152, 38, 40, 40, color::black);
   Brain.Screen.drawRectangle(152, 0, 40, 40, color::blue);
   //R6
   Brain.Screen.drawRectangle(190, 190, 40, 40, color::black);
   Brain.Screen.drawRectangle(190, 152, 40, 40, color::black);
   Brain.Screen.drawRectangle(190, 114, 40, 40, color::black);
   Brain.Screen.drawRectangle(190, 76, 40, 40, color::black);
   Brain.Screen.drawRectangle(190, 38, 40, 40, color::blue);
   Brain.Screen.drawRectangle(190, 0, 40, 40, color::black);
   //Score Zones-Red
   Brain.Screen.drawRectangle(0, 00, 30, 25, color::red);
   Brain.Screen.drawRectangle(0, 0, 26, 21, color::black);
   Brain.Screen.drawRectangle(0, 206, 24, 24, color::red);
   Brain.Screen.drawRectangle(0, 210, 20, 20, color::black);
   //Score Zones-Blue
   Brain.Screen.drawRectangle(200, 0, 30, 25, color::blue);
   Brain.Screen.drawRectangle(204, 0, 26, 21, color::black);
   Brain.Screen.drawRectangle(205, 206, 24, 24, color::blue);
   Brain.Screen.drawRectangle(209, 210, 20, 20, color::black);
   //Tape
   Brain.Screen.setPenWidth(3);
   Brain.Screen.drawLine(77, 37, 37, 77);
   Brain.Screen.drawLine(151, 37, 191, 77);
   Brain.Screen.setPenWidth(4);
   Brain.Screen.drawLine(114, 0, 114, 227);
   //Towers
   Brain.Screen.setPenWidth(2);
   Brain.Screen.drawCircle(114, 56, 10);
   Brain.Screen.drawCircle(114, 114, 10);
   Brain.Screen.drawCircle(114, 170, 10);  
   Brain.Screen.drawCircle(190, 114, 10);
   Brain.Screen.drawCircle(38, 114, 10);
   Brain.Screen.drawCircle(57, 225, 10, color::red);
   Brain.Screen.drawCircle(172, 225, 10, color::blue);
}
3 Likes

thanks for sharing!

From a user experience perspective, providing visual feedback is great! Though in the heat of competition teams will still not look at the color tiled they placed their robot on to confirm the right autonomous was selected :frowning:

3 Likes