

And the value of the sensor is 0 if the touch sensor is not pressed. When the touch sensor is pressed this whole condition is no longer true, it is false and this whole loop will end and when the loops end we have line 14 and line 15 executed. This is a very very standard struction in most programming languages. So, while the sensor value is 0 which means that the sensor is not touched we move forward. And if the sensor is touched, we finish the loop. This means it is touched and we just set the values for the two motors to 0, the power of the motors and they stop. While this condition is true these two lines will execute.Īgain, we have a structure in the language called 'while loop'. If the condition is not true then the loop will end and line 14 will be executed. What we should check is: Is the sensor touched? So we have a function in the language called 'sensor value'.

We're getting the value of the sensor, touch sensor. While the sensor is touched execute these two lines, move forward.Īnd if the value of the touch sensor is equal to 0 then we execute line 10 and 11. If the sensor is touched then execute these two lines. There's such a structure in the language called 'while loop'. Now the bumper switch is connected to the cortex controller. We then implement the program and we're ready to start it. Let's go and see how we implement the program.
#Vex robotc tutorial software#
In the software we have to configure the touch sensor and we go to 'Motor and Sensor Setup', then we have the motors in the motors tab configured and in the 'VEX Cortex Digital Sensors' on port 1 because we've connected it on port 1 we add a touch sensor. And I'll connect the bumper switch to digital input 1. We just pull on this part and connectRobot Virtual Worlds (RVW), developed by Robomatter, is a high-end virtual environment that enables students to learn programming concepts with or without a physical robot. RVW uses a virtual VEX Cortex or VEX IQ robot with motors and sensors in 3D environments which can be programmed with ROBOTC, the same language as physical robots.
#Vex robotc tutorial how to#
