{"mode":"Blocks","workspace":"<xml xmlns=\"http://www.w3.org/1999/xhtml\"><variables><variable type=\"\" id=\"_2.^beQjx|FGt38A,8(E\" islocal=\"false\" iscloud=\"false\" arraylength=\"0\" arraywidth=\"0\">pressedNumber</variable><variable type=\"boolean\" id=\"lEPI}-w|2FDbDRA^/5O$\" islocal=\"false\" iscloud=\"false\" arraylength=\"0\" arraywidth=\"0\">buttonPressed</variable></variables><block type=\"iq_events_when_started\" id=\".NsXwU_L.OuU1l7Sho$F\" x=\"-10\" y=\"71\"><next><block type=\"iq_variables_set_variable\" id=\"]3-(T.u-bg^@AuSHX7Y2\"><field name=\"VARIABLE\" id=\"_2.^beQjx|FGt38A,8(E\" variabletype=\"\">pressedNumber</field><value name=\"VALUE\"><shadow type=\"math_number\" id=\"d]iWCEzU-LmOf;u~C*$@\"><field name=\"NUM\">1</field></shadow></value><next><block type=\"iq_control_forever\" id=\"rtYO83|}9aA1tu{EYShn\"><statement name=\"SUBSTACK\"><block type=\"iq_control_if_then_else\" id=\"s50EX-6FIR[a5WC0]*.~\"><value name=\"CONDITION\"><block type=\"iq_operator_equal_to\" id=\"i!M7P@::CX5-^N{`,.Yv\"><value name=\"OPERAND1\"><shadow type=\"math_number\" id=\"yA%:T.5WjW*L`GnYt}vi\"><field name=\"NUM\"></field></shadow><block type=\"iq_operator_remainder\" id=\"cT2]1T?HLs!2ot2N8G#.\"><value name=\"NUM1\"><shadow type=\"math_number\" id=\"/gWR#sS70v5:UFy+Fe7`\"><field name=\"NUM\"></field></shadow><block type=\"iq_variables_variable\" id=\"Zkt.;jatXfZy~r*gbAYq\"><field name=\"VARIABLE\" id=\"_2.^beQjx|FGt38A,8(E\" variabletype=\"\">pressedNumber</field></block></value><value name=\"NUM2\"><shadow type=\"math_number\" id=\"rVw:4CP];)m-V7o:=fEv\"><field name=\"NUM\">2</field></shadow></value></block></value><value name=\"OPERAND2\"><shadow type=\"math_number\" id=\"GGrTTy+a!MMrDJy$rTut\"><field name=\"NUM\">0</field></shadow></value></block></value><statement name=\"SUBSTACK\"><block type=\"iq_looks_set_touchled_color\" id=\"!%DH]*mRy]%).|IX!gH5\"><field name=\"TOUCHLED\">TouchLED8</field><value name=\"COLOR\"><shadow type=\"iq_looks_colorlist\" id=\".qfUwM9VCmH}JX4tU^Th\"><field name=\"COLOR\">green</field></shadow></value></block></statement><statement name=\"SUBSTACK2\"><block type=\"iq_looks_set_touchled_color\" id=\"oX%q}:w_iUx6BOVf[Le3\"><field name=\"TOUCHLED\">TouchLED8</field><value name=\"COLOR\"><shadow type=\"iq_looks_colorlist\" id=\"5$j#Q%~c2Ew6kWV}LEzo\"><field name=\"COLOR\">red</field></shadow></value></block></statement></block></statement></block></next></block></next></block><block type=\"iq_events_when_bumper\" id=\"%M]Hi{1#@Rk6JQ;2x[7,\" x=\"570\" y=\"70\"><field name=\"BUMPER\">Bumper10</field><field name=\"EVENTTYPE\">pressed</field><next><block type=\"iq_variables_change_variable\" id=\"uHH1bC.LmL.y)%CW,?dh\"><field name=\"VARIABLE\" id=\"_2.^beQjx|FGt38A,8(E\" variabletype=\"\">pressedNumber</field><value name=\"VALUE\"><shadow type=\"math_number\" id=\"`T,@{:chcBLytaB{;1gr\"><field name=\"NUM\">1</field></shadow></value></block></next></block></xml>","rconfig":[{"port":[1,6],"name":"Drivetrain","customName":false,"deviceType":"Drivetrain","deviceClass":"smartdrive","setting":{"type":"2-motor","wheelSize":"200mm","gearRatio":"1:1","direction":"fwd","gyroType":"integrated","width":"173","unit":"mm","wheelbase":"76","wheelbaseUnit":"mm","xOffset":"0","yOffset":"0","thetaOffset":"0"},"triportSourcePort":22},{"port":[10],"name":"Bumper10","customName":false,"deviceType":"Bumper","deviceClass":"bumper","setting":{},"triportSourcePort":22},{"port":[8],"name":"TouchLED8","customName":false,"deviceType":"TouchLED","deviceClass":"touchled","setting":{},"triportSourcePort":22},{"port":[],"name":"Controller","customName":false,"deviceType":"Controller","deviceClass":"controller","setting":{"left":"","leftDir":"false","right":"","rightDir":"false","e":"","eDir":"false","f":"","fDir":"false","l3r3":"","l3r3Dir":"false","drive":"none"},"triportSourcePort":22}],"slot":4,"platform":"IQ","sdkVersion":"20220726.10.00.00","appVersion":"2.4.5","minVersion":"2.4.0","fileFormat":"1.2.0","icon":"","targetBrainGen":"Second","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 IQ 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 IQ MACROS\n\n\n// Robot configuration code.\ninertial BrainInertial = inertial();\nmotor LeftDriveSmart = motor(PORT1, 1, false);\nmotor RightDriveSmart = motor(PORT6, 1, true);\n\nsmartdrive Drivetrain = smartdrive(LeftDriveSmart, RightDriveSmart, BrainInertial, 200);\n\nbumper Bumper10 = bumper(PORT10);\ntouchled TouchLED8 = touchled(PORT8);\ncontroller Controller = controller();\n\nvoid calibrateDrivetrain() {\n  wait(200, msec);\n  Brain.Screen.print(\"Calibrating\");\n  Brain.Screen.newLine();\n  Brain.Screen.print(\"Inertial\");\n  BrainInertial.calibrate();\n  while (BrainInertial.isCalibrating()) {\n    wait(25, msec);\n  }\n\n  // Clears the screen and returns the cursor to row 1, column 1.\n  Brain.Screen.clearScreen();\n  Brain.Screen.setCursor(1, 1);\n}\n\n// Generated code.\n\n\n\n// define variable for remote controller enable/disable\nbool RemoteControlCodeEnabled = true;\n\n\n\n// Include the IQ Library\n#include \"vex.h\"\n  \n// Allows for easier use of the VEX Library\nusing namespace vex;\n\nfloat pressedNumber;\n\nbool buttonPressed;\n\n// \"when started\" hat block\nint whenStarted1() {\n  pressedNumber = 1.0;\n  while (true) {\n    if (fmod(pressedNumber,2.0) == 0.0) {\n      TouchLED8.setColor(green);\n    }\n    else {\n      TouchLED8.setColor(red);\n    }\n  wait(20, msec);\n  }\n  return 0;\n}\n\n// \"when Bumper10 pressed\" hat block\nvoid onevent_Bumper10_pressed_0() {\n  pressedNumber = pressedNumber + 1.0;\n}\n\n\nint main() {\n  // Calibrate the Drivetrain Gyro\n  calibrateDrivetrain();\n\n  // register event handlers\n  Bumper10.pressed(onevent_Bumper10_pressed_0);\n\n  wait(15, msec);\n  whenStarted1();\n}","target":"Physical"}