Virtual Robot Simulator Official Guidebook
  • Coverpage
  • Introduction
  • FTC
    • Centerstage Game and Basic Rules
    • Powerplay Game and Basic Rules
  • VRS
  • Programming
    • User Interface
    • Blocks
      • LinearOpMode
      • Gamepad
      • Actuators
        • DcMotor
        • CRServo
        • Servo
      • Sensors
        • DistanceSensor
        • IMU
        • IMU-BNO055.Parameters
        • REV Color/Range Sensor
        • TouchSensor
      • Utilities
        • Acceleration
        • AngleUnit
        • AngularVelocity
        • Axis
        • Color
        • Orientation
        • PIDFCoefficients
        • Position
        • Range
        • Telemetry
        • Time
        • Vector
        • Velocity
      • Logic
      • Loops
      • Math
      • Text
      • Lists
      • Variables
      • Function
      • Miscellaneous
    • Basic Lessons
      • Drivetrain
      • IMU
      • Color Sensor
      • Telemetry
      • Range Sensor
      • Touch Sensor
      • Servo
      • CRServo
      • DCMotor
      • Logic and Loops
      • Functions
      • Tele-Op Control
    • Advanced Lessons
      • Advanced Tele-Op Control
    • Video Lessons
    • Simulation
    • Exploratory Activities
      • Wandering Robot
  • Robot Arena
    • Single Player
    • Activities
      • Coding Competition
      • CenterStage Competition
  • Conclusion
  • Author
  • Other Editions
Powered by GitBook
On this page
  1. Programming
  2. Blocks

Gamepad

PreviousLinearOpModeNextActuators

Last updated 9 months ago

A series of blocks that allow you to read gamepad button presses, joystick positions, and trigger values to command your robot's movements and actions.

Here is a diagram laying out what each button is mapped to:

There are four main types of gamepad blocks:

  • Button blocks: These blocks represent the various buttons on the gamepad (A, B, X, Y, D-pad, bumpers, triggers, etc.). They return a boolean value (true or false) indicating whether the button is pressed or not.

  • Joystick blocks: These blocks provide the X and Y coordinates of the left and right joysticks. The values range from -1 to 1, representing the full range of motion of the joystick.

  • Trigger blocks: These blocks provide a value between 0 and 1, representing the trigger's position.

  • The status of the gamepad. There is only one block of this type. AtRest block returns true if all analog sticks and triggers are in their rest position.