VEX V5 Python API
Public Member Functions | List of all members
vex.Sonar Class Reference

Inherits vex.TriDevice.

Public Member Functions

def __init__ (self, triport_port)
 Use this class when programming with a sonar sensor. More...
 
def value (self)
 Gets the value of the distance sensor. More...
 
def distance (self, distanceUnits=DistanceUnits.MM)
 Gets the value of the distance sensor. More...
 

Constructor & Destructor Documentation

◆ __init__()

def vex.Sonar.__init__ (   self,
  triport_port 
)

Use this class when programming with a sonar sensor.

Member Function Documentation

◆ value()

def vex.Sonar.value (   self)

Gets the value of the distance sensor.

Returns
Returns an integer that represents the value of the sonar sensor.

◆ distance()

def vex.Sonar.distance (   self,
  distanceUnits = DistanceUnits.MM 
)

Gets the value of the distance sensor.

Parameters
distanceUnitsThe unit type that the previous value should be treated as.
Returns
Returns an integer that represents the unit value specified by the parameter of the sonar sensor.