{"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=\"130\" y=\"38\"><next><block type=\"v5_looks_set_font\" id=\"(bme44b{J}zM.kt.l/%|\"><field name=\"FONT\">prop20</field><next><block type=\"v5_looks_set_fill_color\" id=\"9*I%eAjG(`9!=S`fEjR@\"><field name=\"COLOR\">green</field><next><block type=\"v5_looks_draw_rectangle\" id=\"f__6F.DIc39MRSP4/q~a\"><value name=\"X\"><shadow type=\"math_whole_number\" id=\"b+fan@ERX[r2D6s#+,n7\"><field name=\"NUM\">0</field></shadow></value><value name=\"Y\"><shadow type=\"math_whole_number\" id=\"ztfM)fnt4R9z7bSZFt7t\"><field name=\"NUM\">0</field></shadow></value><value name=\"WIDTH\"><shadow type=\"math_whole_number\" id=\"N=C#Vvwh^5(f6!dAXaX%\"><field name=\"NUM\">240</field></shadow></value><value name=\"HEIGHT\"><shadow type=\"math_whole_number\" id=\"+27[@o,Nkt/8#U}kD2`5\"><field name=\"NUM\">240</field></shadow></value><next><block type=\"v5_looks_set_cursor\" id=\"WvV!.$OiV3ef+VTzsh9f\"><field name=\"TARGET\">Brain</field><value name=\"ROW\"><shadow type=\"math_whole_number\" id=\"!MD3k{A3y]}A:iq5:cae\"><field name=\"NUM\">1</field></shadow></value><value name=\"COLUMN\"><shadow type=\"math_whole_number\" id=\"u{JW?%y7Y7!t4K|6XX!-\"><field name=\"NUM\">1</field></shadow></value><next><block type=\"v5_looks_print\" id=\"WV]=b3o?b;)Yh;[9?B15\"><field name=\"TARGET\">Brain</field><field name=\"andsetcursortonextrow_mutator\">FALSE</field><value name=\"DATA\"><shadow type=\"text\" id=\"?n!V[-t/w9[):WW+4gUM\"><field name=\"TEXT\">Open Claw</field></shadow></value><next><block type=\"v5_looks_set_fill_color\" id=\"%53Jrod,f8{vwF~8`KEK\"><field name=\"COLOR\">red</field><next><block type=\"v5_looks_draw_rectangle\" id=\"ndEIfuq.l9`N]$v|@Ok_\"><value name=\"X\"><shadow type=\"math_whole_number\" id=\".r5{$_cZVN@-9wA([@Wv\"><field name=\"NUM\">240</field></shadow></value><value name=\"Y\"><shadow type=\"math_whole_number\" id=\"t,9b?(aIx#BXlY*:GdHy\"><field name=\"NUM\">0</field></shadow></value><value name=\"WIDTH\"><shadow type=\"math_whole_number\" id=\"^ls*kpg0jT^{:($.b~.^\"><field name=\"NUM\">240</field></shadow></value><value name=\"HEIGHT\"><shadow type=\"math_whole_number\" id=\"@1s~M25oWj8K?1uk}Nud\"><field name=\"NUM\">240</field></shadow></value><next><block type=\"v5_looks_set_cursor\" id=\"ip_`m4gWl%p*4oawF2nj\"><field name=\"TARGET\">Brain</field><value name=\"ROW\"><shadow type=\"math_whole_number\" id=\"I:@=Uhpe6oLlup8x|pBC\"><field name=\"NUM\">1</field></shadow></value><value name=\"COLUMN\"><shadow type=\"math_whole_number\" id=\"3|-YFdqGf_}8?%Mqq_uH\"><field name=\"NUM\">25</field></shadow></value><next><block type=\"v5_looks_print\" id=\"k0yinbg|O1,vn}kN#5?Q\"><field name=\"TARGET\">Brain</field><field name=\"andsetcursortonextrow_mutator\">FALSE</field><value name=\"DATA\"><shadow type=\"text\" id=\"+!A]t%yr5d:+:sq+KSJd\"><field name=\"TEXT\">Close Claw</field></shadow></value><next><block type=\"v5_looks_set_pen_color\" id=\")h@ia7fc!:=@{a93B!bV\"><field name=\"COLOR\">white</field><field name=\"TARGET\">Brain</field><next><block type=\"v5_motion_set_motor_controller_velocity\" id=\"U@03[oAzu6;a6TNK}[Kt\"><field name=\"MOTOR\">noise</field><value name=\"VELOCITY\"><shadow type=\"math_number\" id=\"pWkMDXS%x3fn-Ov84;q?\"><field name=\"NUM\">100</field></shadow></value><next><block type=\"v5_motion_spin_motor_controller\" id=\"zM.0,|^xj6$/zF9bZ;=?\"><field name=\"MOTOR\">noise</field><field name=\"DIRECTION\">fwd</field><next><block type=\"v5_control_forever\" id=\"Q+?6vXi()pj0R-!(vM[5\"><statement name=\"SUBSTACK\"><block type=\"v5_control_wait_until\" id=\"qc,8pog.RFtnX#q)P^GS\"><value name=\"CONDITION\"><block type=\"v5_sensing_screen_pressed\" id=\"#|d`GLgH}sn+;i|2Z)?r\"></block></value><next><block type=\"v5_control_if_then_else\" id=\",V9BuDKGPT=,K$i$,)w_\"><value name=\"CONDITION\"><block type=\"v5_operator_greater_than\" id=\".~?8CByfWw*1jAEO!]M?\"><value name=\"OPERAND1\"><shadow type=\"math_number\" id=\"0DKwL4BkumP#?8:;MlJl\"><field name=\"NUM\"></field></shadow><block type=\"v5_sensing_screen_position\" id=\".df9]]Mf)l+1rXPF_#v-\"><field name=\"AXIS\">x</field></block></value><value name=\"OPERAND2\"><shadow type=\"math_number\" id=\"8.gH,}l;OI55Lr/$J792\"><field name=\"NUM\">240</field></shadow></value></block></value><statement name=\"SUBSTACK\"><block type=\"v5_other_comment\" id=\"9*Y}:=C8WGXY^t=,;3No\"><value name=\"COMMENT\"><shadow type=\"comment_text\" id=\"_mvd[ohlklSE[sx!|:T+\"><field name=\"comment\">close</field></shadow></value><next><block type=\"v5_motion_spin_for\" id=\"=g,B![Mkg0OJG_:2BuS+\"><field name=\"MOTOR\">mainmot</field><field name=\"DIRECTION\">rev</field><field name=\"UNITS\">deg</field><field name=\"anddontwait_mutator\">FALSE</field><value name=\"AMOUNT\"><shadow type=\"math_number\" id=\"vQJ]+!KHgh,6L8@*_Mz#\"><field name=\"NUM\">230</field></shadow></value></block></next></block></statement><statement name=\"SUBSTACK2\"><block type=\"v5_other_comment\" id=\"J_]WoDV-]/mBMp%iVi~L\"><value name=\"COMMENT\"><shadow type=\"comment_text\" id=\"`kMVTnwsd#*cP#PW5dDL\"><field name=\"comment\">open</field></shadow></value><next><block type=\"v5_motion_spin_for\" id=\"turq}LLoP`A#X=Yz[QD/\"><field name=\"MOTOR\">mainmot</field><field name=\"DIRECTION\">fwd</field><field name=\"UNITS\">deg</field><field name=\"anddontwait_mutator\">FALSE</field><value name=\"AMOUNT\"><shadow type=\"math_number\" id=\"_9EeV?X?%Kw`Xs#K)-bY\"><field name=\"NUM\">230</field></shadow></value></block></next></block></statement></block></next></block></statement></block></next></block></next></block></next></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":"mainmot","customName":true,"deviceType":"Motor","deviceClass":"motor","setting":{"reversed":"false","fwd":"forward","rev":"reverse","gear":"ratio18_1"},"triportSourcePort":22},{"port":[1],"name":"noise","customName":true,"deviceType":"Motor393","deviceClass":"motor29","setting":{"reversed":"false","fwd":"forward","rev":"reverse"},"triportSourcePort":22}],"slot":0,"platform":"V5","sdkVersion":"20211013.15.00.00","appVersion":"2.2.1","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 mainmot = motor(PORT1, ratio18_1, false);\n\nmotor29 noise = motor29(Brain.ThreeWirePort.A, false);\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// \"when started\" hat block\nint whenStarted1() {\n  Brain.Screen.setFont(prop20);\n  Brain.Screen.setFillColor(green);\n  Brain.Screen.drawRectangle(0, 0, 240, 240);\n  Brain.Screen.setCursor(1, 1);\n  Brain.Screen.print(\"Open Claw\");\n  Brain.Screen.setFillColor(red);\n  Brain.Screen.drawRectangle(240, 0, 240, 240);\n  Brain.Screen.setCursor(1, 25);\n  Brain.Screen.print(\"Close Claw\");\n  Brain.Screen.setPenColor(white);\n  noise.setVelocity(100.0, percent);\n  noise.spin(forward);\n  while (true) {\n    waitUntil(Brain.Screen.pressing());\n    if (Brain.Screen.xPosition() > 240.0) {\n      // close\n      mainmot.spinFor(reverse, 230.0, degrees, true);\n    }\n    else {\n      // open\n      mainmot.spinFor(forward, 230.0, degrees, true);\n    }\n  wait(5, msec);\n  }\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"}