Code: Select all
x, y, z, temp = qmc5883.read_scaled()
Code: Select all
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "QMC5883.py", line 156, in read_scaled
File "QMC5883.py", line 144, in read_raw
KeyboardInterrupt:
EDIT: I assume the hanging happens when the read_raw() calls ready(). So when I called print(qmc5883.ready()), and it prints 0. I'm not exactly sure what that means.
EDIT 2: I added 4.7K resistors to SDA and SCL pins, and one one boot I got the ENODEV error again. Unpluged USB, plugged it back again, opened serial, ran the code - no ENODEV this time, but the code hangs again on the read_raw() function. It all feels so very random, but I can't point my finger at it. Even when I make absolutely no changes to hardware, and repeat exact same steps, I sometimes get random results - sometimes it works, sometimes it hangs, sometimes it's the ENODEV error... How do I debug such a thing?