PiStorms  4.015
PiStorms Library Reference by mindsensors.com
 All Classes Namespaces Files Functions Variables
mindsensors.DIST Class Reference

DIST: this class provides functions for DISTNx from mindsensors.com for read and write operations. More...

Inheritance diagram for mindsensors.DIST:

Public Member Functions

def __init__
 Initialize the class with the i2c address of your Dist-Nx. More...
 
def command
 Writes a value to the command register. More...
 
def get_distance
 Reads the distance in millimeters. More...
 
def get_distance_inches
 Reads the distance in inches. More...
 
def get_voltage
 Reads the voltage of the Dist-Nx. More...
 

Static Public Attributes

tuple DIST_ADDRESS = (0x02)
 Default Dist-Nx I2C Address.
 
int COMMAND = 0x41
 Command Register.
 
int DISTANCE = 0x42
 Distance Register. More...
 
int VOLTAGE = 0x44
 Voltage Register. More...
 

Detailed Description

DIST: this class provides functions for DISTNx from mindsensors.com for read and write operations.

Constructor & Destructor Documentation

def mindsensors.DIST.__init__ (   self,
  dist_address = DIST_ADDRESS 
)

Initialize the class with the i2c address of your Dist-Nx.

Parameters
selfThe object pointer.
dist_addressAddress of your Dist-Nx.

Member Function Documentation

def mindsensors.DIST.command (   self,
  command 
)

Writes a value to the command register.

Parameters
selfThe object pointer.
commandValue to write to the command register.
def mindsensors.DIST.get_distance (   self)

Reads the distance in millimeters.

Parameters
selfThe object pointer.
def mindsensors.DIST.get_distance_inches (   self)

Reads the distance in inches.

Parameters
selfThe object pointer.
def mindsensors.DIST.get_voltage (   self)

Reads the voltage of the Dist-Nx.

Parameters
selfThe object pointer.

Member Data Documentation

int mindsensors.DIST.DISTANCE = 0x42
static

Distance Register.

Will return an integer value

int mindsensors.DIST.VOLTAGE = 0x44
static

Voltage Register.

Will return an integer value


The documentation for this class was generated from the following file: