vex package¶
VEX module.
Robot Mesh Python B: robotmesh.com/studio/content/docs/vexiq-python_b/html/namespacevex.html
- class vex.Brain[source]¶
Bases:
SingletonDeviceVEX Brain.
ROBOT MESH PYTHON B:
Use the Brain class to see battery information, or write to the screen.
robotmesh.com/studio/content/docs/vexiq-python_b/html/classvex_1_1_brain.html
- property buttonCheck: BrainButton¶
Brain Button CHECK.
- property buttonDown: BrainButton¶
Brain Button DOWN.
- property buttonUp: BrainButton¶
Brain Button UP.
- property sound: BrainSound¶
Brain Sound.
- class vex.BrainButton(id: str)[source]¶
Bases:
objectBrain Button.
ROBOT MESH PYTHON B:
Use the Button class to get values from the Brain’s buttons.
robotmesh.com/studio/content/docs/vexiq-python_b/html/classvex_1_1_brain_button.html
- pressing() bool[source]¶
Return Button’s pressed status.
VEXCODE PYTHON:
Reports if the specified button on the VEX IQ Brain is being pressed.
Reports True if the specified Brain button is pressed. Reports False if the specified Brain button is not pressed.
After brain. enter a Brain button to receive the pressed status on.
Supported Brain buttons are as follows: - buttonUp / buttonLeft - buttonDown / buttonRight - buttonCheck
ROBOT MESH PYTHON B:
Get the pressed status of a button.
Returns: True if pressed, False otherwise.
- class vex.BrainLcd[source]¶
Bases:
SingletonDeviceBrain LCD Screen.
ROBOT MESH PYTHON B:
Use this class to write or draw to the brain’s LCD screen.
21 characters wide
5 lines (1-5)
robotmesh.com/studio/content/docs/vexiq-python_b/html/classvex_1_1_brain_lcd.html
- clear_screen()[source]¶
Clear Brain LCD Screen.
VEXCODE PYTHON:
Clears the entire VEX IQ Brain’s Screen.
Clear Screen will not reset the Brain’s screen cursor.
Use the Set Cursor command to set the Brain’s cursor to the desired position.
ROBOT MESH PYTHON B:
Clear the whole screen.
- print_line(number: int, text: str)[source]¶
Print to a line on Brain LCD Screen.
ROBOT MESH PYTHON B:
Print a number, string, or boolean at a particular line.
(clearing the rest of the line)
Parameters number: Line to print on, 1 is top line. text: object to print, usually a string.
Use “” to clear the line. For multiple arguments, use format like “x: %g y: %g” % (x, y) -> “x: 123 y: 456” Supported format flags are g (all) x (hex) d (int) f (float)
- class vex.BrainSound[source]¶
Bases:
SingletonDeviceBrain Sound.
ROBOT MESH PYTHON B:
robotmesh.com/studio/content/docs/vexiq-python_b/html/classvex_1_1_brain_sound.html
- play(note: NoteType, octave: int = 3, duration: float = 0.5, timeUnits: TimeUnits = TimeUnits.SEC)[source]¶
Play note/sound on Brain Sound Speaker.
ROBOT MESH PYTHON B:
Play a musical note on the speaker.
Parameters: - note: musical note to play: NoteType enum value - octave: octave of the note [1-7], optional - duration: time. 0 to start playing without blocking. Default 0.5 - timeUnits: of time for the duration. Default sec.
- play_melody(melody: str)[source]¶
Play musical melody.
ROBOT MESH PYTHON B:
Play a melody form a string in a quasi musical alphabet notation.
(cdefgab)
Parameters: - melody: string [cdefgab]: musical alphabet for notes,
space: pause, +/-: increase/decrease octave of following notes 0-9: set duration of following notes
(in 1/8s: 1=eighth note…8 = full note)
- play_raw(note: NoteType, duration: float = 0.5, timeUnits: TimeUnits = TimeUnits.SEC)[source]¶
Play note/sound on Brain Sound Speaker.
ROBOT MESH PYTHON B:
Play a musical note on the speaker.
Parameters - note: musical note to play: 0=silence/stop, [1-56] numeric value - duration: time. 0 to start playing without blocking. Default 0.5 - timeUnits: of time for the duration. Default sec.
- play_wave(waveType: int, waitForCompletion: bool = True)[source]¶
Play WAV.
ROBOT MESH PYTHON B:
Play the wave sample.
Parameters: - waveType: type of the wave sample sound to play [0..15] - waitForCompletion: wait for the sample to finish playing
- set_sound_effect(effect: int)[source]¶
Set Sound Effect.
ROBOT MESH PYTHON B:
Set the sound effect type for subsequent notes played.
Parameters - effect: effect type [0..15]
- class vex.BrakeType(value)[source]¶
Bases:
IntEnumMotor Brake Types.
ROBOT MESH PYTHON B:
The defined units for brake values.
robotmesh.com/studio/content/docs/vexiq-python_b/html/classvex_1_1_brake_type.html
- BRAKE: int = 1¶
- COAST: int = 0¶
- HOLD: int = 2¶
- class vex.Bumper(index: Ports)[source]¶
Bases:
DeviceBumper Switch Sensor.
ROBOT MESH PYTHON B:
robotmesh.com/studio/content/docs/vexiq-python_b/html/classvex_1_1_bumper.html
- class vex.ColorHue(value)[source]¶
Bases:
IntEnumColor Hue.
ROBOT MESH PYTHON B:
Defined color hue values.
robotmesh.com/studio/content/docs/vexiq-python_b/html/classvex_1_1_color_hue.html
- BLUE: int = 9¶
- BLUE_GREEN: int = 8¶
- BLUE_VIOLET: int = 10¶
- GREEN: int = 7¶
- NONE: int = 0¶
- ORANGE: int = 3¶
- RED: int = 1¶
- RED_ORANGE: int = 2¶
- RED_VIOLET: int = 12¶
- VIOLET: int = 11¶
- WHITE: int = 13¶
- YELLOW: int = 5¶
- YELLOW_GREEN: int = 6¶
- YELLOW_ORANGE: int = 4¶
- class vex.Colorsensor(index: Ports, is_grayscale: bool = False, proximity: float = 700)[source]¶
Bases:
DeviceVEX Color Sensor.
ROBOT MESH PYTHON B:
robotmesh.com/studio/content/docs/vexiq-python_b/html/classvex_1_1_colorsensor.html
- colorname12() int[source]¶
Return one of 12 colors or NONE.
ROBOT MESH PYTHON B:
Get the name of the detected color.
Returns: enum value of the closest color detected out of 12 possible values of ColorType (or NONE).
- colorname3() int[source]¶
Return one of RED, GREEN and BLUE.
ROBOT MESH PYTHON B:
Get the name of the detected color.
Returns: enum value for the closest color detected out of ColorHue.RED, GREEN or BLUE (or NONE).
- grayscale(raw: bool = False) int[source]¶
Return grayscale value.
ROBOT MESH PYTHON B:
Get the grayscale value detected by the color sensor.
Parameters: - raw: if True, raw value will be returned, otherwise a percentage
Returns: integer that represents the detected grayscale value (percentage 0-100 or raw 0-1024).
- led(state: bool)[source]¶
Set LED state.
ROBOT MESH PYTHON B:
Turn the led on the color sensor on or off.
Parameters: - state: if True, LED will be turned on
- class vex.Controller[source]¶
Bases:
SingletonDeviceController.
ROBOT MESH PYTHON B:
Use the Controller class to get values from the remote controller.
(as well as write to the controller’s screen)
robotmesh.com/studio/content/docs/vexiq-python_b/html/classvex_1_1_controller.html
- property axisA: ControllerAxis¶
Return Controller Axis A.
- property axisB: ControllerAxis¶
Return Controller Axis B.
- property axisC: ControllerAxis¶
Return Controller Axis C.
- property axisD: ControllerAxis¶
Return Controller Axis D.
- property buttonEDown: ControllerButton¶
Return Controller Button E-Down.
- property buttonEUp: ControllerButton¶
Return Controller Button E-Up.
- property buttonFDown: ControllerButton¶
Return Controller Button F-Down.
- property buttonFUp: ControllerButton¶
Return Controler Button F-Up.
- property buttonLDown: ControllerButton¶
Return Controller Button L-Down.
- property buttonLUp: ControllerButton¶
Return Controller Button L-Up.
- property buttonRDown: ControllerButton¶
Return Controller Button R-Down.
- property buttonRUp: ControllerButton¶
Return Controller Button R-Up.
- class vex.ControllerAxis(parent: Controller, axtype: str)[source]¶
Bases:
objectController Joystick Axis.
ROBOT MESH PYTHON B:
Use the Axis class to get values from one of the controller’s joysticks.
robotmesh.com/studio/content/docs/vexiq-python_b/html/classvex_1_1_controller_axis.html
- class vex.ControllerButton(mask: str)[source]¶
Bases:
objectController Button.
ROBOT MESH PYTHON B:
Use the Button class to get values from the controller’s buttons.
robotmesh.com/studio/content/docs/vexiq-python_b/html/classvex_1_1_controller_button.html
- class vex.DirectionType(value)[source]¶
Bases:
IntEnumMovement Direction Types.
ROBOT MESH PYTHON B:
The defined units for direction values.
robotmesh.com/studio/content/docs/vexiq-python_b/html/classvex_1_1_direction_type.html
- FWD: int = 0¶
- REV: int = 1¶
- class vex.DistanceUnits(value)[source]¶
Bases:
IntEnumDistance Units.
ROBOT MESH PYTHON B:
The measurement units for distance values.
robotmesh.com/studio/content/docs/vexiq-python_b/html/classvex_1_1_distance_units.html
- CM: int = 2¶
- IN: int = 1¶
- MM: int = 0¶
- class vex.FadeType(value)[source]¶
Bases:
IntEnumTouch LED Fade Types.
ROBOT MESH PYTHON B:
robotmesh.com/studio/content/docs/vexiq-python_b/html/classvex_1_1_fade_type.html
- FAST: int = 2¶
- OFF: int = 0¶
- SLOW: int = 1¶
- class vex.Gyro(index: Ports, calibrate: bool = True)[source]¶
Bases:
DeviceGyro Sensor.
ROBOT MESH PYTHON B:
robotmesh.com/studio/content/docs/vexiq-python_b/html/classvex_1_1_gyro.html
- heading(rotationUnits: RotationUnits = RotationUnits.DEG) float[source]¶
Return Gyro Heading Angle Value.
ROBOT MESH PYTHON B:
Get the angle of the gyro sensor.
Parameters: - rotationUnits: The measurement unit for the gyro device.
- is_calibrating() bool[source]¶
Check if Gyro Sensor is calibrating.
ROBOT MESH PYTHON B:
Return True while gyro sensor is performing a requested recalibration.
(changing to false once recalibration has completed)
Returns True if gyro is still calibrating.
- rotation(rotationUnits: RotationUnits = RotationUnits.DEG) float[source]¶
Return Gyro Cumulative Rotation Angle Value.
ROBOT MESH PYTHON B:
Get the absolute angle of the gyro sensor.
Parameters: - rotationUnits: The measurement unit for the gyro device.
- set_heading(value: float = 0, rotationUnits: RotationUnits = RotationUnits.DEG)[source]¶
Set Gyro Heading Angle Value.
ROBOT MESH PYTHON B:
Set the gyro sensor angle to angle.
Parameters: - value: The new heading for the gyro - rotationUnits: The rotation unit for the heading
- set_rotation(value: float = 0, rotationUnits: RotationUnits = RotationUnits.DEG)[source]¶
Set Gyro Cumulative Rotation Angle Value.
ROBOT MESH PYTHON B:
Set the gyro sensor rotation to angle.
Parameters: - value: The new absolute angle for the gyro - rotationUnits: The rotation unit for the angle
- start_calibration(gyroCalibrationType: GyroCalibrationType = GyroCalibrationType.QUICK, waitForCompletion: bool = True)[source]¶
Start calibrating Gyro Sensor.
ROBOT MESH PYTHON B:
Start recalibration of the gyro.
Parameters: - gyroCalibrationType: amount of time for calibration,
GyroCalibrationType enum value.
waitForCompletion: wait for calibration to complete
- class vex.GyroCalibrationType(value)[source]¶
Bases:
IntEnumGyro Calibration Types.
ROBOT MESH PYTHON B:
robotmesh.com/studio/content/docs/vexiq-python_b/html/classvex_1_1_gyro_calibration_type.html
- ACCURATE: int = 2¶
- QUICK: int = 0¶
- SLOW: int = 1¶
- class vex.Motor(index: Ports, reverse: bool = False)[source]¶
Bases:
DeviceMotor.
ROBOT MESH PYTHON B:
robotmesh.com/studio/content/docs/vexiq-python_b/html/classvex_1_1_motor.html
- current() float[source]¶
Return Motor’s Electrical Current.
ROBOT MESH PYTHON B:
Get the electrical current of the motor.
Returns: a float that represents the electrical current of the motor in Amps.
- did_timeout() bool[source]¶
Return whether Motor timed out.
ROBOT MESH PYTHON B:
Return True if the last motor operation timed out.
- is_done() bool[source]¶
Check if Motor has finished spinning.
ROBOT MESH PYTHON B:
Determine if spin_for/spin_to command has reached its target position.
Returns: False if the motor is on and is rotating to a target, True if the motor is done rotating to a target.
- is_spinning() bool[source]¶
Check if Motor is spinning.
ROBOT MESH PYTHON B:
Determine if a spin_for/spin_to command is in progress.
Returns: True if the motor is on and is rotating to a target, False if the motor is done rotating to a target.
- reset_rotation()[source]¶
Reset Motor Rotation Value to 0.
ROBOT MESH PYTHON B:
Reset the motor’s encoder to the value of zero.
- rotation(rotationUnits: RotationUnits = RotationUnits.DEG) float[source]¶
Return Motor’s cumulative Rotation Angle Value.
ROBOT MESH PYTHON B:
Get the current rotation of the motor’s encoder.
Parameters: rotationUnits: The measurement unit for the rotation.
Returns: a float that represents the current rotation of the motor in the units defined in the parameter.
- set_max_torque(value: float, torqueUnits: TorqueUnits = TorqueUnits.NM)[source]¶
Set Max Torque.
ROBOT MESH PYTHON B:
Set the max torque of the motor.
Parameters: - value: Sets the amount of torque (max 0.414 Nm) - torqueUnits: The measurement unit for the torque value.
- set_max_torque_current(value: float)[source]¶
Set Max Torque Current.
ROBOT MESH PYTHON B:
Set the max torque of the motor.
Parameters: - value: Sets the amount of torque in Amps (max 1.2A)
- set_max_torque_percent(value: float)[source]¶
Set Max Torque Percent.
ROBOT MESH PYTHON B:
Set the max torque of the motor as a percentage.
Parameters: - value: Sets the amount of torque (0 to 100%)
- set_reversed(is_reversed: bool)[source]¶
Set Reversed Mode.
ROBOT MESH PYTHON B:
Set the motor mode to “reverse”.
(which will make motor commands spin the motor in the opposite direction)
Parameters: - is_reversed: If set to True, motor commands
spin the motor in the opposite direction.
- set_rotation(value: float, rotationUnits: RotationUnits = RotationUnits.DEG)[source]¶
Set Motor Rotation Value to specific value.
ROBOT MESH PYTHON B:
Set value of motor’s encoder to value specified in parameter.
Parameters: - value: Sets the amount of rotation. - rotationUnits: The measurement unit for the rotation,
a RotationUnits enum value.
- set_stopping(brakeType: BrakeType)[source]¶
Set Stopping Mode.
ROBOT MESH PYTHON B:
Set stopping mode of the motor by passing a brake mode as a parameter.
(note this will stop the motor if it’s spinning)
Parameters: - brakeType: The stopping mode can be set to
BrakeType.COAST, BRAKE, or HOLD.
- set_timeout(time: float, timeUnits: TimeUnits = TimeUnits.SEC)[source]¶
Set Motor Timeout Threshold.
ROBOT MESH PYTHON B:
Set the timeout for the motor.
If the motor does not reach its commanded position prior to the completion of the timeout, the motor will stop.
Parameters: - time: Sets the amount of time. - timeUnits: The measurement unit for the time, a TimeUnits enum value.
- set_velocity(velocity: float, velocityUnits: VelocityUnits = VelocityUnits.PCT)[source]¶
Set Velocity.
ROBOT MESH PYTHON B:
Set velocity of the motor based on the parameters set in the command.
This command will not run the motor. Any subsequent call that does not contain a specified motor velocity will use this value.
Parameters: - velocity: Sets the amount of velocity. - velocityUnits: The measurement unit for the velocity,
a VelocityUnits enum value.
- spin(dir: DirectionType, velocity: float, velocityUnits: VelocityUnits = VelocityUnits.PCT)[source]¶
Spin Motor.
ROBOT MESH PYTHON B:
Turn on the motor and spins it.
(in a specified direction and a specified velocity)
Parameters: - dir: The direction to spin the motor, DirectionType enum value. - velocity: Sets the amount of velocity. - velocityUnits: The measurement unit for the velocity,
a VelocityUnits enum value.
- spin_for(dir: DirectionType, rotation: float, rotationUnits: RotationUnits = RotationUnits.DEG, velocity: Optional[float] = None, velocityUnits: VelocityUnits = VelocityUnits.PCT, waitForCompletion: bool = True) bool[source]¶
Spin Motor for a certain Rotation Angle Value.
ROBOT MESH PYTHON B:
Turn on the motor and spins it.
(to a relative target rotation value at a specified velocity)
Parameters: - dir: The direction to spin the motor, DirectionType enum value. - rotation: Sets the amount of rotation. - rotationUnits: The measurement unit for the rotation value. - velocity: Sets the amount of velocity. - velocityUnits: The measurement unit for the velocity value. - waitForCompletion: (Optional) If True, your program will wait
until the motor reaches the target rotational value. If false, the program will continue after calling this function. By default, this parameter is true.
Returns: Returns a Boolean that signifies when the motor has reached the target rotation value.
- spin_for_time(dir: DirectionType, time: str, timeUnits: TimeUnits = TimeUnits.SEC, velocity: Optional[float] = None, velocityUnits: VelocityUnits = VelocityUnits.PCT)[source]¶
Spin Motor for a certain Time Duration.
ROBOT MESH PYTHON B:
Turn on the motor and spins it.
(to a relative target time value at a specified velocity)
Parameters: - dir: direction to spin in, a DirectionType enum value or None. - time: Sets the amount of time. - timeUnits: The measurement unit for the time value. - velocity: Sets the amount of velocity. - velocityUnits: The measurement unit for the velocity value.
- spin_to(rotation: float, rotationUnits: RotationUnits = RotationUnits.DEG, velocity: Optional[float] = None, velocityUnits: VelocityUnits = VelocityUnits.PCT, waitForCompletion: bool = True) bool[source]¶
Spin Motor to target Rotation Angle Value.
ROBOT MESH PYTHON B:
Turn on the motor and spins it.
(to an absolute target rotation value at a specified velocity)
Parameters: - rotation: Sets the amount of rotation. - rotationUnits: The measurement unit for the rotation value. - velocity: Sets the amount of velocity. - velocityUnits: The measurement unit for the velocity value. - waitForCompletion: (Optional) If True, your program will wait
until the motor reaches the target rotational value. If false, the program will continue after calling this function. By default, this parameter is true.
- start_spin_for(dir: DirectionType, rotation: float, rotationUnits: RotationUnits = RotationUnits.DEG, velocity: Optional[float] = None, velocityUnits: VelocityUnits = VelocityUnits.PCT)[source]¶
Start spinning motor for a certain Rotation Angle Value.
ROBOT MESH PYTHON B:
Start spinning a motor.
(to a relative target rotation but does not wait for the motor to reach that target)
Parameters: - dir: direction to spin in, a DirectionType enum value or None. - rotation: Sets the amount of rotation. - rotationUnits: The measurement unit for the rotation value. - velocity: Sets the amount of velocity. - velocityUnits: The measurement unit for the velocity value.
- start_spin_to(rotation: float, rotationUnits: RotationUnits = RotationUnits.DEG, velocity: Optional[float] = None, velocityUnits: VelocityUnits = VelocityUnits.PCT)[source]¶
Start spinning Motor to a certain Target Rotation Angle Value.
ROBOT MESH PYTHON B:
Start spinning a motor.
(to an absolute target rotation but does not wait for the motor to reach that target)
Params: - rotation: Sets the amount of rotation. - rotationUnits: The measurement unit for the rotation value. - velocity: Sets the amount of velocity. - velocityUnits: The measurement unit for the velocity value.
- stop(brakeType: Optional[BrakeType] = None)[source]¶
Stop Motor.
ROBOT MESH PYTHON B:
Stop the motor using the default brake mode.
Parameters: - brakeType: The brake mode can be set to
BrakeType.COAST, BRAKE, or HOLD.
- timeout(timeUnits: TimeUnits = TimeUnits.SEC) float[source]¶
Return Motor Timeout.
ROBOT MESH PYTHON B:
Return a timeout in given time units.
- velocity(velocityUnits: VelocityUnits = VelocityUnits.PCT) float[source]¶
Return Motor’s Velocity.
ROBOT MESH PYTHON B:
Get the current velocity of the motor.
Parameters: - velocityUnits: The measurement unit for the velocity.
Returns: a float that represents the current velocity of the motor in the units defined in the parameter.
- class vex.NoteType(value)[source]¶
Bases:
IntEnumMusical Note.
ROBOT MESH PYTHON B:
Musical note to play.
robotmesh.com/studio/content/docs/vexiq-python_b/html/classvex_1_1_note_type.html
- A: int = 6¶
- B: int = 7¶
- C: int = 1¶
- D: int = 2¶
- E: int = 3¶
- F: int = 4¶
- G: int = 5¶
- silence: int = 0¶
- class vex.Ports(value)[source]¶
Bases:
IntEnumPorts.
ROBOT MESH PYTHON B:
robotmesh.com/studio/content/docs/vexiq-python_b/html/classvex_1_1_ports.html
- PORT1: int = 0¶
- PORT10: int = 9¶
- PORT11: int = 10¶
- PORT12: int = 11¶
- PORT2: int = 1¶
- PORT3: int = 2¶
- PORT4: int = 3¶
- PORT5: int = 4¶
- PORT6: int = 5¶
- PORT7: int = 6¶
- PORT8: int = 7¶
- PORT9: int = 8¶
- class vex.RotationUnits(value)[source]¶
Bases:
IntEnumRotation Units.
ROBOT MESH PYTHON B:
The measurement units for rotation values.
robotmesh.com/studio/content/docs/vexiq-python_b/html/classvex_1_1_rotation_units.html
- DEG: int = 0¶
- RAW: int = 99¶
- REV: int = 1¶
- class vex.Sonar(index: Ports)[source]¶
Bases:
DeviceSonar (Distance Sensor).
ROBOT MESH PYTHON B:
robotmesh.com/studio/content/docs/vexiq-python_b/html/classvex_1_1_sonar.html
- distance(distanceUnits: DistanceUnits = DistanceUnits.MM) int[source]¶
Return measured distance to nearby object.
ROBOT MESH PYTHON B:
Get the value of the sonar sensor.
Parameters: - distanceUnits: The measurement unit for
the sonar device, DistanceUnits enum value.
Returns: an integer that represents the unit value specified by the parameter.
- set_maximum(distance: float, distanceUnits: DistanceUnits = DistanceUnits.MM)[source]¶
Set maximum measurable distance.
ROBOT MESH PYTHON B:
Set the maximum distance (default 2.5m).
Parameters: - distance: maximum distance to be measured in units - distanceUnits: a DistanceUnits enum value for the measurement unit.
- class vex.SoundType(value)[source]¶
Bases:
EnumSound Effect.
VEXCODE PYTHON:
Sound Effect
- ALARM = 8¶
- ALARM2 = 15¶
- DOOR_CLOSE = 10¶
- FILLUP = 4¶
- HEADLIGHTS_OFF = 6¶
- HEADLIGHTS_ON = 5¶
- POWER_DOWN = 16¶
- RATCHET = 11¶
- RATCHET2 = 14¶
- SIREN = 1¶
- SIREN2 = 13¶
- TADA = 9¶
- TOLLBOOTH = 7¶
- WRENCH = 12¶
- WRONG_WAY = 2¶
- WRONG_WAY_SLOW = 3¶
- class vex.TimeUnits(value)[source]¶
Bases:
IntEnumTime Units.
ROBOT MESH PYTHON B:
The measurement units for time values.
robotmesh.com/studio/content/docs/vexiq-python_b/html/classvex_1_1_time_units.html
- MSEC: int = 1¶
- SEC: int = 0¶
- class vex.TorqueUnits(value)[source]¶
Bases:
IntEnumTorque Units.
ROBOT MESH PYTHON B:
The measurement units for torque values.
robotmesh.com/studio/content/docs/vexiq-python_b/html/classvex_1_1_torque_units.html
- IN_LB: int = 1¶
- NM: int = 0¶
- PCT: int = 2¶
- class vex.Touchled(index: Ports)[source]¶
Bases:
DeviceTouch LED.
ROBOT MESH PYTHON B:
Use this class when programming with the touch LED device.
robotmesh.com/studio/content/docs/vexiq-python_b/html/classvex_1_1_touchled.html
- blink(color: hex, on_time: float = 0.25, off_time: float = 0.25)[source]¶
Blink color.
ROBOT MESH PYTHON B:
Set the led in the touchled sensor as blinking.
Parameters: - color: color value: 0xRRGGBB - on_time: The time the led should remain on in seconds - off_time: The time the led should remain off in seconds
- blink_hue(colorHue: ColorHue, on_time: float = 0.25, off_time: float = 0.25)[source]¶
Blink Color Hue.
ROBOT MESH PYTHON B:
Set the led in the touchled sensor as blinking.
Parameters: - colorHue: The color of the led: ColorHue enum value - on_time: The time the led should remain on in seconds - off_time: The time the led should remain off in seconds
- blink_rgb(red: int, green: int, blue: int, on_time: float = 0.25, off_time: float = 0.25)[source]¶
Blink RGB Color.
ROBOT MESH PYTHON B:
Set the led in the touchled sensor as blinking.
Parameters: - red: The red value of the led 0-255 - green: The green value of the led 0-255 - blue: The blue value of the led 0-255 - on_time: The time the led should remain on in seconds - off_time: The time the led should remain off in seconds
- brightness(brightness: int)[source]¶
Set Brightness Percent Level.
ROBOT MESH PYTHON B:
Turn on the led in the touchled sensor, or change current brightness.
Parameters: - brightness: The brightness for the led 0-100
- default_fade(fadeType: FadeType)[source]¶
Set default Fade Type.
ROBOT MESH PYTHON B:
Set the default fade time for the touchled sensor.
Parameters: - fadeType: The type of fade the touchled
will use: FadeType.SLOW, FAST or OFF
- on(color: hex, brightness: int = 100)[source]¶
Turn on color.
ROBOT MESH PYTHON B:
Turn on the led in the touchled sensor.
Parameters: - color: color value: 0xRRGGBB - brightness: The brightness for the led
- on_hue(colorHue: ColorHue, brightness: int = 100)[source]¶
Turn on Color Hue.
ROBOT MESH PYTHON B:
Turn on the led in the touchled sensor.
Parameters: - colorHue: The color of the led: ColorHue enum value - brightness: The brightness for the led
- on_rgb(red: int, green: int, blue: int, brightness: int = 100)[source]¶
Turn on RGB color.
ROBOT MESH PYTHON B:
Turn on the led in the touchled sensor.
Parameters: - red: The red value of the led, 0-255 - green: The green value of the led, 0-255 - blue: The blue value of the led, 0-255 - brightness: The brightness for the led, 0-100
- class vex.TurnType(value)[source]¶
Bases:
IntEnumMovement Turn Types.
ROBOT MESH PYTHON B:
Left or right turn.
robotmesh.com/studio/content/docs/vexiq-python_b/html/classvex_1_1_turn_type.html
- LEFT: int = 0¶
- RIGHT: int = 1¶
- class vex.VelocityUnits(value)[source]¶
Bases:
IntEnumVelocity Units.
ROBOT MESH PYTHON B:
The measurement units for velocity values.
robotmesh.com/studio/content/docs/vexiq-python_b/html/classvex_1_1_velocity_units.html
- DPS: int = 2¶
- PCT: int = 0¶
- RAW: int = 99¶
- RPM: int = 1¶
- vex.wait(time: float, timeUnits: TimeUnits = TimeUnits.SEC)[source]¶
Wait.
ROBOT MESH PYTHON B:
Wait for a specific amount of time.
Identical to sys.sleep().
Parameters time: The length of time to wait timeUnits: The units of time (default seconds)
robotmesh.com/studio/content/docs/vexiq-python_b/html/namespacevex.html#a6b9ca2db773bef3a3569a0d6b22f2749