ZIOCC / Zio-Qwiic-Ultrasonic-Distance-Sensor

5 stars 8 forks source link

i2C Address #1

Open safariace opened 4 years ago

safariace commented 4 years ago

I'm using a Raspberry Pi connected to a ZIO Ultrasonic with a qwiic connection.

I2CDetect returns no scan for the HC_SR04. I see the other i2c devices on the bus, but no the ultrasonic sensor. The arduino code has these two lines:

define SLAVE_BROADCAST_ADDR 0x00 //default address

define SLAVE_ADDR 0x00 //SLAVE_ADDR 0xA0-0xAF

Which implies address 0x00

The comment seems to imply the slave address should be in the range 0xA0-AF .

AlexChuSmartPrototyping commented 4 years ago

Hi, the sensor default address is 0x00, this is correct, you can just send the read commend to this address then you will get the distance data. There is way to change the sensor address, but unless there is address conflict, I won't recommend to do so.

JamesB7 commented 3 years ago

A sensor should never use address 0x00. It is reserved for I2C General Calls, which by spec may be used by some devices to configure their addresses (such devices will always be listening on 0x00 as well as their current address).

marvinrobot42 commented 7 months ago

I agree with JamesB7 in that the I2C sensor interface needs its own address, not 0x00 which is the "any address" or broadcast to all devices on bus address. Hopefully Sparkfun can help with getting your own I2C address.