platypush/plugins/gpio/zeroborg/lib/__init__.py
def ScanForZeroBorg(busNumber=1):
    """
ScanForZeroBorg([busNumber])

Scans the I?C bus for a ZeroBorg boards and returns a list of all usable addresses
The busNumber if supplied is which I?C bus to scan, 0 for Rev 1 boards, 1 for Rev 2 boards, if not supplied
the default is 1
    """
    found = []
    print('Scanning I?C bus #%d' % busNumber)
    bus = ZeroBorg()
    for address in range(0x03, 0x78, 1):
        try:
            bus.InitBusOnly(busNumber, address)
            i2cRecv = bus.RawRead(COMMAND_GET_ID, I2C_NORM_LEN)
            if len(i2cRecv) == I2C_NORM_LEN:
                if i2cRecv[1] == I2C_ID_ZEROBORG:
                    print('Found ZeroBorg at %02X' % address)
                    found.append(address)
                else:
                    pass
            else:
                pass
        except KeyboardInterrupt:
            raise
        except Exception as e:
            print('Error on ZeroBorg scan: {}: {}'.format(type(e), str(e)))

    if len(found) == 0:
        print('No ZeroBorg boards found, is bus #%d correct (should be 0 for Rev 1, 1 for Rev 2)' % busNumber)
    elif len(found) == 1:
        print('1 ZeroBorg board found')
    else:
        print('%d ZeroBorg boards found' % (len(found)))
    return found

ScanForZeroBorg([busNumber])

Scans the I?C bus for a ZeroBorg boards and returns a list of all usable addresses
The busNumber if supplied is which I?C bus to scan, 0 for Rev 1 boards, 1 for Rev 2 boards, if not supplied
the default is 1
    
ScanForZeroBorg([busNumber])
Scans the I?C bus for a ZeroBorg boards and returns a list of all usable addresses
The busNumber if supplied is which I?C bus to scan, 0 for Rev 1 boards, 1 for Rev 2 boards, if not supplied
the default is 1
ScanForZeroBorg ( [ busNumber ] ) Scans the I?C bus for a ZeroBorg boards and returns a list of all usable addresses The busNumber if supplied is which I?C bus to scan 0 for Rev 1 boards 1 for Rev 2 boards if not supplied the default is 1
def ScanForZeroBorg(busNumber=1):
    found = []
    print('Scanning I?C bus #%d' % busNumber)
    bus = ZeroBorg()
    for address in range(0x03, 0x78, 1):
        try:
            bus.InitBusOnly(busNumber, address)
            i2cRecv = bus.RawRead(COMMAND_GET_ID, I2C_NORM_LEN)
            if len(i2cRecv) == I2C_NORM_LEN:
                if i2cRecv[1] == I2C_ID_ZEROBORG:
                    print('Found ZeroBorg at %02X' % address)
                    found.append(address)
                else:
                    pass
            else:
                pass
        except KeyboardInterrupt:
            raise
        except Exception as e:
            print('Error on ZeroBorg scan: {}: {}'.format(type(e), str(e)))
    if len(found) == 0:
        print('No ZeroBorg boards found, is bus #%d correct (should be 0 for Rev 1, 1 for Rev 2)' % busNumber)
    elif len(found) == 1:
        print('1 ZeroBorg board found')
    else:
        print('%d ZeroBorg boards found' % (len(found)))
    return found
def ScanForZeroBorg ( busNumber = 1 ) : found = [ ] print ( 'Scanning I?C bus #%d' % busNumber ) bus = ZeroBorg ( ) for address in range ( 0x03 , 0x78 , 1 ) : try : bus . InitBusOnly ( busNumber , address ) i2cRecv = bus . RawRead ( COMMAND_GET_ID , I2C_NORM_LEN ) if len ( i2cRecv ) == I2C_NORM_LEN : if i2cRecv [ 1 ] == I2C_ID_ZEROBORG : print ( 'Found ZeroBorg at %02X' % address ) found . append ( address ) else : pass else : pass except KeyboardInterrupt : raise except Exception as e : print ( 'Error on ZeroBorg scan: {}: {}' . format ( type ( e ) , str ( e ) ) ) if len ( found ) == 0 : print ( 'No ZeroBorg boards found, is bus #%d correct (should be 0 for Rev 1, 1 for Rev 2)' % busNumber ) elif len ( found ) == 1 : print ( '1 ZeroBorg board found' ) else : print ( '%d ZeroBorg boards found' % ( len ( found ) ) ) return found
ScanForZeroBorg([busNumber])
Scans the I?C bus for a ZeroBorg boards and returns a list of all usable addresses
The busNumber if supplied is which I?C bus to scan, 0 for Rev 1 boards, 1 for Rev 2 boards, if not supplied
the default is 1
ScanForZeroBorg ( [ busNumber ] ) Scans the I?C bus for a ZeroBorg boards and returns a list of all usable addresses The busNumber if supplied is which I?C bus to scan 0 for Rev 1 boards 1 for Rev 2 boards if not supplied the default is 1
"""
ScanForZeroBorg([busNumber])

Scans the I?C bus for a ZeroBorg boards and returns a list of all usable addresses
The busNumber if supplied is which I?C bus to scan, 0 for Rev 1 boards, 1 for Rev 2 boards, if not supplied
the default is 1
    """
busNumber