Skip to main content

Multitasking Snapshot

Create a coordinate system on the VIQC Virtual Skills Field with the initial position of the Hero Bot as the origin(0,0). Create an algorithm to use [Drive for] and [Turn to heading] blocks, the Arm Motor, the Intake Motor, and the Bumper Switch Sensor to drive the Hero Bot to specific positions to remove all the Discs from a blue Dispenser, pick up and launch three Discs to the 4-Point Goal Zone as fast as possible!

  • Select the VIQC Virtual Skills - Slapshot Playground.
  • Drive the Hero Bot to the position located at (60, 290), turn to the blue Dispenser, and remove all the Discs from it.
    • Use the and don’t wait feature of the spin ArmMotor block to enable the Hero Bot to drive to the next position while lowering the Arm after knocking the Dispenser.
  • Drive the Hero Bot to the position located at (1000, 175).
  • Code the Hero Bot to pick up and launch three Discs to the 4-Point Goal Zone.
    • Create an algorithm using the broadcast event to trigger the intake process to enable the Hero Bot to drive while spinning the Intake Motor until a Disc has been loaded.
    • Create an algorithm using a variable to coordinate the Drivetrain and the Intake Motor behaviors to avoid mutual interference between two Disc launch processes.
    • Drive the Hero Bot reverse to the position located at (800, 300), pick up a Disc, and launch it to the 4-Point Goal Zone.
    • Drive the Hero Bot reverse to the position located at (900, 500), pick up a Disc, and launch it to the 4-Point Goal Zone.
    • Drive the Hero Bot reverse to the position located at (800, 575), pick up a Disc, and launch it to the 4-Point Goal Zone.

Helpful Hints

  • The and don’t wait feature of the spin ArmMotor block will cause other blocks to continue running while the Arm Motor spins. To use this feature, select the arrow to expand and don't wait.
    VEXcode Spin for block that reads 'spin ArmMotor reverse for 90 degrees and don't wait'.
    • Matching Python command:

      arm_motor.spin_for(REVERSE, 90, DEGREES, wait=False)
  • Use the broadcast block from the Events category to trigger the intake process.
    VEXcode Broadcast block that reads 'broadcast check'.
    • Matching Python command:

      check.broadcast()
  • Use the when I receive block from the Events category to run the attached stack of blocks when the triggered message is received.
    VEXcode When I receive block that reads 'when I receive check'.
    • Matching Python command:

      def OnEvent_check():
      	pass
      
      check = Event()
      check(OnEvent_check)