I2C scanner

I2C scanner

Postby Acexbe » Mon Oct 08, 2018 1:44 pm

Hello,
This snipped of code lists all connected devices to the I2C bus.
The bus can manage 128 devices.
The first seven are reserved, so 120 are available.
This code is intended for I2C devices with a 7 bit address.
However, newer devices have a 10 bit address.
As the ezsbc1 seems to handle 10 bit addresses, you can increase the address range (tested and working).

I2CINIT(100000)
I2CTIME(10)
FOR address=8 TO 120

I2CWR(address,0x00,"",0)
IF I2CBUSY(address)=0 THEN
PRINT hex$(address)
ENDIF

NEXT address

END
Acexbe
 
Posts: 3
Joined: Tue Aug 28, 2018 2:57 pm

Return to EzSBC1

Who is online

Users browsing this forum: No registered users and 1 guest