Skip to content

SU02 Module

This is a Module for the SU02 digital input. The xChip is based on the ADC081C021 analogue to digital converter manufactured by Texas Instruments. The board uses I2C for communication.

Data Sheets:

SU02 class

class SU02

class SU02(self, drvname, addr=0x55, clk=100000)

Create an instance of the SU02 class.

Arguments:

  • drvname – I2C Bus used ‘( I2C0, … )’
  • addr – Slave address, default 0x55
  • clk – Clock speed, default 100kHz
SU02.init

init()

Configures the registers of ADC081C021. Call after instantiation of the class. Exception raised if unsuccessful

SU02.getState

getState()

Reads the state of the input.

Returns False for Open and True for closed.

SU02.getVolatge

getVolatge()

Reads the voltage on the input.

Returns the voltage.