benben11
Posts: 2
Joined: Sun Jan 19, 2020 3:15 pm

HMC5883L

Sun Jan 19, 2020 3:18 pm

Hello,
I try to use the HMC588L sensor in order to measure the heading.
I try this site https://www.instructables.com/id/Interf ... -Raspberr/
but when i compile it, i got this error:
from i2clibraries import i2c_hmc5883l
ModuleNotFoundError: No module named 'i2clibraries'

i need help, please.
Thanks

User avatar
joan
Posts: 14960
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: HMC5883L

Sun Jan 19, 2020 4:19 pm

Go through the tutorial again taking particular care with the parts when you download and build the various libraries. Any problems?

benben11
Posts: 2
Joined: Sun Jan 19, 2020 3:15 pm

Re: HMC5883L

Sun Jan 19, 2020 4:46 pm

Thanks about your answer/
But now i got this problem:
Traceback (most recent call last):
File "/home/pi/project/code/ben.py", line 5, in <module>
print(hmc5883l)
File "/home/pi/project/code/i2clibraries/i2c_hmc5883l.py", line 40, in __str__
ret_str += "Heading: "+self.getHeadingString()+"\n"
File "/home/pi/project/code/i2clibraries/i2c_hmc5883l.py", line 131, in getHeadingString
(degrees, minutes) = self.getHeading()
File "/home/pi/project/code/i2clibraries/i2c_hmc5883l.py", line 113, in getHeading
headingRad = math.atan2(scaled_y, scaled_x)
TypeError: must be real number, not NoneType

May you help me pls?

Return to “Troubleshooting”