{"mode":"Blocks","workspace":"<xml xmlns=\"http://www.w3.org/1999/xhtml\"><variables><variable type=\"\" id=\"U`9aA+=)r+L1tzA.)-qi\" islocal=\"false\" iscloud=\"false\" arraylength=\"0\" arraywidth=\"0\">myVariable</variable></variables><block type=\"v5_events_when_started\" id=\".NsXwU_L.OuU1l7Sho$F\" x=\"70\" y=\"110\"><next><block type=\"v5_looks_set_font\" id=\"+*Z!|rpKqHQse+;]U6T4\"><field name=\"FONT\">mono40</field><next><block type=\"v5_looks_set_print_precision\" id=\"5.W2UBb/ZjU6_Ja{qXWm\"><field name=\"PRECISION\">2</field><field name=\"TARGET\">Brain</field><next><block type=\"v5_motion_set_motor_velocity\" id=\"c*Xa2-iG|x#.{[Ww=2hc\"><field name=\"MOTOR\">leftMotor</field><field name=\"UNITS\">pct</field><value name=\"VELOCITY\"><shadow type=\"math_number\" id=\"zxP+C2UXp;pZLO;V5#,Q\"><field name=\"NUM\">10</field></shadow></value><next><block type=\"v5_motion_set_motor_velocity\" id=\"fy|JMZfPm5KJ2Ma@(qKQ\"><field name=\"MOTOR\">rightMotor</field><field name=\"UNITS\">pct</field><value name=\"VELOCITY\"><shadow type=\"math_number\" id=\"|Di%9Pcf@u|/YQ+f!%O8\"><field name=\"NUM\">10</field></shadow></value><next><block type=\"v5_motion_spin_for\" id=\";UbD3[R!bh8t(mTmdr]=\"><field name=\"MOTOR\">leftMotor</field><field name=\"DIRECTION\">fwd</field><field name=\"UNITS\">rev</field><field name=\"anddontwait_mutator\">TRUE</field><value name=\"AMOUNT\"><shadow type=\"math_number\" id=\"];eqi{LCG[.E0k?xv3k#\"><field name=\"NUM\">2.78</field></shadow></value><next><block type=\"v5_motion_spin_for\" id=\"Z:WHDODgRhO:]^eQ|zdH\"><field name=\"MOTOR\">rightMotor</field><field name=\"DIRECTION\">fwd</field><field name=\"UNITS\">rev</field><field name=\"anddontwait_mutator\">FALSE</field><value name=\"AMOUNT\"><shadow type=\"math_number\" id=\"u[q|Be0iIMc_-eTG:{M4\"><field name=\"NUM\">2.78</field></shadow></value><next><block type=\"v5_looks_print\" id=\"+=L~v]4mXd/Tredy16LW\"><field name=\"TARGET\">Brain</field><field name=\"andsetcursortonextrow_mutator\">FALSE</field><value name=\"DATA\"><shadow type=\"text\" id=\"pX4e/$,M%W87e72IMXf0\"><field name=\"TEXT\">Left Motor: </field></shadow></value><next><block type=\"v5_looks_print\" id=\"ZYM[fYIduLC4XP6WFKi)\"><field name=\"TARGET\">Brain</field><field name=\"andsetcursortonextrow_mutator\">TRUE</field><value name=\"DATA\"><shadow type=\"text\" id=\"mb**_!Up41b#|K3$9mGn\"><field name=\"TEXT\">Left Motor: </field></shadow><block type=\"v5_sensing_position_of_motor\" id=\"]`+3Z9{Gq)PTaYZY,0N+\"><field name=\"MOTOR\">leftMotor</field><field name=\"UNITS\">rev</field></block></value><next><block type=\"v5_looks_print\" id=\"p5uyy`.r-#y,3o{1wC[D\"><field name=\"TARGET\">Brain</field><field name=\"andsetcursortonextrow_mutator\">FALSE</field><value name=\"DATA\"><shadow type=\"text\" id=\"52,s*0?f+4~Dxhz#PsH$\"><field name=\"TEXT\">Right Motor: </field></shadow></value><next><block type=\"v5_looks_print\" id=\"v6bX6/1[H1KA(f9rBz@@\"><field name=\"TARGET\">Brain</field><field name=\"andsetcursortonextrow_mutator\">TRUE</field><value name=\"DATA\"><shadow type=\"text\" id=\"xfh4nNBZA|7F(cM_[m7^\"><field name=\"TEXT\">Left Motor: </field></shadow><block type=\"v5_sensing_position_of_motor\" id=\"l!!NayLOt|bw_VmR8W8X\"><field name=\"MOTOR\">rightMotor</field><field name=\"UNITS\">rev</field></block></value></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></xml>","rconfig":[{"port":[1],"name":"leftMotor","customName":true,"deviceType":"Motor","deviceClass":"motor","setting":{"reversed":"false","fwd":"forward","rev":"reverse","gear":"ratio18_1"},"triportSourcePort":22},{"port":[10],"name":"rightMotor","customName":true,"deviceType":"Motor","deviceClass":"motor","setting":{"reversed":"true","fwd":"forward","rev":"reverse","gear":"ratio18_1"},"triportSourcePort":22}],"slot":0,"platform":"V5","sdkVersion":"20220726.10.00.00","appVersion":"2.4.5","minVersion":"2.4.0","fileFormat":"1.0.1","icon":"","targetBrainGen":"First","cppStatus":"true","cpp":"// Make sure all required headers are included.\n#include <stdio.h>\n#include <stdlib.h>\n#include <stdbool.h>\n#include <math.h>\n#include <string.h>\n\n\n#include \"vex.h\"\n\nusing namespace vex;\n\n// Brain should be defined by default\nbrain Brain;\n\n\n// START V5 MACROS\n#define waitUntil(condition)                                                   \\\n  do {                                                                         \\\n    wait(5, msec);                                                             \\\n  } while (!(condition))\n\n#define repeat(iterations)                                                     \\\n  for (int iterator = 0; iterator < iterations; iterator++)\n// END V5 MACROS\n\n\n// Robot configuration code.\nmotor leftMotor = motor(PORT1, ratio18_1, false);\n\nmotor rightMotor = motor(PORT10, ratio18_1, true);\n\n\n\n\n\n\n// Generated code.\n\n// Include the V5 Library\n#include \"vex.h\"\n  \n// Allows for easier use of the VEX Library\nusing namespace vex;\n\nint Brain_precision = 0, Console_precision = 0;\n\nfloat myVariable;\n\n// Used to find the format string for printing numbers with the\n// desired number of decimal places\nconst char* printToBrain_numberFormat() {\n  // look at the current precision setting to find the format string\n  switch(Brain_precision){\n    case 0:  return \"%.0f\"; // 0 decimal places (1)\n    case 1:  return \"%.1f\"; // 1 decimal place  (0.1)\n    case 2:  return \"%.2f\"; // 2 decimal places (0.01)\n    case 3:  return \"%.3f\"; // 3 decimal places (0.001)\n    default: return \"%f\"; // use the print system default for everthing else\n  }\n}\n\n// \"when started\" hat block\nint whenStarted1() {\n  Brain.Screen.setFont(mono40);\n  Brain_precision = 2;\n  leftMotor.setVelocity(10.0, percent);\n  rightMotor.setVelocity(10.0, percent);\n  leftMotor.spinFor(forward, 2.78, turns, false);\n  rightMotor.spinFor(forward, 2.78, turns, true);\n  Brain.Screen.print(\"Left Motor: \");\n  Brain.Screen.print(printToBrain_numberFormat(), static_cast<float>(leftMotor.position(turns)));\n  Brain.Screen.newLine();\n  Brain.Screen.print(\"Right Motor: \");\n  Brain.Screen.print(printToBrain_numberFormat(), static_cast<float>(rightMotor.position(turns)));\n  Brain.Screen.newLine();\n  return 0;\n}\n\n\nint main() {\n  // post event registration\n\n  // set default print color to black\n  printf(\"\\033[30m\");\n\n  // wait for rotation sensor to fully initialize\n  wait(30, msec);\n\n  whenStarted1();\n}","target":"Physical"}