adafruit / Adafruit_CircuitPython_LSM6DS

CircuitPython helper library for the LSM6DS family of motion sensors from ST
MIT License
25 stars 21 forks source link

Misleading error message on WHO_AM_I ID check #63

Open strg-v opened 11 months ago

strg-v commented 11 months ago

In the following line, you check for the chip version ID (register is called "WHO_AM_I" in the datasheet):

https://github.com/adafruit/Adafruit_CircuitPython_LSM6DS/blob/c4d6b88c5d537e0ba6b430987ccb2020475dc2e5/adafruit_lsm6ds/__init__.py#L230C22-L230C22

I designed a PCB with the LSM6DS3TR, but the manufacturer of the PCB has a messed up data bank assembled my PCB with the LSM6DS33.

The error message states that I have a wiring issue. A more appropriate message would be "wrong selected chip class, selected X found y". Or something like that.

That took quite some time to figure the actual error out.

tekktrik commented 8 months ago

What do you think about:

f"Failed to find {self.__class__.__name__} - check your wiring/chip (found {self._chip_id})!"