VEX IQ Python API
Classes | Functions | Variables
vexiq Namespace Reference

VexIQ controller Python API for Robot Mesh. More...

Classes

class  AnalogSensor
 Analog Sensor. More...
 
class  Bumper
 
class  ColorSensor
 Config Color Sensor: detects color hue or a grayscale value. More...
 
class  DistanceSensor
 Config Ultrasonic distance sensor. More...
 
class  Gyro
 Config Gyroscope sensor. More...
 
class  Joystick
 Config Joystick controller. More...
 
class  Motor
 Config Motor with power setting and distance encoder More...
 
class  NamedColor
 Enumeration of named colors (for TouchLed and ColorSensor) More...
 
class  Output
 Digital output. More...
 
class  Serial
 Config Serial port to host. More...
 
class  TouchLed
 Config Touch Led: detects touch and shines in various colors More...
 
class  VisionObject
 
class  VisionSensor
 Vision Sensor device. More...
 

Functions

def VisionObjectList ()
 DEPRECATED. More...
 
def lcd_write (text, row=1, col=1)
 Output text to LCD at a specific position. More...
 
def battery_voltage ()
 Get brain battery voltage, in volts. More...
 
def sound_note (note, octave=None, duration=0.5)
 Play a musical note on the speaker. More...
 
def sound_wave (wave_id, wait_for_end=True)
 play the wave sample with the given ID [0...15] More...
 
def sound_melody (melody)
 Play a melody form a string in a quasi musical alphabet notiation (cdefgab) More...
 
def set_sound_volume (value)
 set the sound volume [1-4] More...
 
def set_sound_effect (type)
 set the sound effect type [0...15] for subsequent notes played More...
 
def is_check_button_pressed ()
 True if the "check" button on the face of the IQ brain is pressed, False otherwise. More...
 
def is_up_button_pressed ()
 True if the "up" button on the face of the IQ brain is pressed, False otherwise. More...
 
def is_down_button_pressed ()
 True if the "down" button on the face of the IQ brain is pressed, False otherwise. More...
 

Variables

int UNIT_INCH = 1
 
int UNIT_CM = 2
 
int UNIT_MM = 3
 
int POWER_UNCHANGED_FWD = 255
 
int POWER_UNCHANGED_REV = -255
 

Detailed Description

VexIQ controller Python API for Robot Mesh.

Copyright 2014 Robot Mesh

Function Documentation

◆ VisionObjectList()

def vexiq.VisionObjectList ( )

DEPRECATED.

Deprecated:
Code to prevent build errors, for consistency with output and analog class TemperatureLM34(AnalogSensor): def init(self, port): """__NATIVE__ return cwrap_raiseNotSupported(); """ pass

Create a vision object list to pass into visionSensor.objects()

◆ lcd_write()

def vexiq.lcd_write (   text,
  row = 1,
  col = 1 
)

Output text to LCD at a specific position.

Parameters
textstring to write.
rowrow, 1 to 5. Default 1.
colcolumn, 1 to 25. Default 1.

◆ battery_voltage()

def vexiq.battery_voltage ( )

Get brain battery voltage, in volts.

Returns
number

◆ sound_note()

def vexiq.sound_note (   note,
  octave = None,
  duration = 0.5 
)

Play a musical note on the speaker.

Parameters
notemusical note to play: 0=silence/stop, [1-56] or [1-7] if an octave is specified
octaveoctave of the note [1-7], optional
durationtime to play in seconds. None to start playing without blocking. Default 0.5

◆ sound_wave()

def vexiq.sound_wave (   wave_id,
  wait_for_end = True 
)

play the wave sample with the given ID [0...15]

Parameters
wave_idsound to play
wait_for_endwait for the sample to finish playing

◆ sound_melody()

def vexiq.sound_melody (   melody)

Play a melody form a string in a quasi musical alphabet notiation (cdefgab)

Parameters
melodystring [cdefgab]: musical alphabet for notes, space: pause, +/-: increase/decrease octave of following notes 0-9: set duration of following notes (in 1/8s: 1=eight note...8 = full note)

◆ set_sound_volume()

def vexiq.set_sound_volume (   value)

set the sound volume [1-4]

Parameters
valuevolume value [1=low...4=high]

◆ set_sound_effect()

def vexiq.set_sound_effect (   type)

set the sound effect type [0...15] for subsequent notes played

Parameters
typeeffect type

◆ is_check_button_pressed()

def vexiq.is_check_button_pressed ( )

True if the "check" button on the face of the IQ brain is pressed, False otherwise.

Returns
bool

◆ is_up_button_pressed()

def vexiq.is_up_button_pressed ( )

True if the "up" button on the face of the IQ brain is pressed, False otherwise.

◆ is_down_button_pressed()

def vexiq.is_down_button_pressed ( )

True if the "down" button on the face of the IQ brain is pressed, False otherwise.

Variable Documentation

◆ UNIT_INCH

int vexiq.UNIT_INCH = 1

◆ UNIT_CM

int vexiq.UNIT_CM = 2

◆ UNIT_MM

int vexiq.UNIT_MM = 3

◆ POWER_UNCHANGED_FWD

int vexiq.POWER_UNCHANGED_FWD = 255

◆ POWER_UNCHANGED_REV

int vexiq.POWER_UNCHANGED_REV = -255