Espera hasta que sea verdad#
This tutorial walks you through using the wait until block to pause a project until a condition is true, using an LED Bumper as an example. By the end, you’ll have a project that turns the LED Bumper green once it’s pressed.
Make sure your robot has an LED Bumper connected. See Configuring Devices if you haven’t added one yet.
Drag a wait until block below the when started block.
cuando inicie :: hat events
esperar hasta <>
Drag the LED Bumper’s pressed? Boolean block into the wait until block’s condition slot.
cuando inicie :: hat events
esperar hasta <¿[LEDBumper2 v] presionado? :: custom-led>
Attach a Set Bumper color block below the wait until block.
cuando inicie :: hat events
esperar hasta <¿[LEDBumper2 v] presionado? :: custom-led>
establecer [LEDBumper2 v] a [rojo v] :: custom-led
Change the color parameter to green.
Make sure your robot is connected to VEXcode. See Connecting to Your Robot if it isn’t connected yet.
Select Start to run the project.
Press the LED Bumper to turn the bumper green.