I2C Python library hmc5883l API

Source: Internet
Author: User
The 'i2c Python library 'of think bowl provides the 'hmc5883l' sensor interface to conveniently obtain sensor information.

# Hmc5883l
Here is the installation method

Http://www.cnblogs.com/hangxin1940/archive/2013/04/04/2999015.html

Http://www.cnblogs.com/hangxin1940/archive/2013/04/05/3000395.html

For detailed code, please move to https://bitbucket.org/thinkbowl/i2clibraries/src/14683feb0f96/i2c_hmc5883l.py? At = Master

# _ Init _ (port, ADDR = 0x1e, Gauss = 1.3)
Constructor

Port 'Port', type A is 0, type B is 1

'Addr 'address. The default value is 1E.

'Gauss 'Gaussian value. The default value is 1.3,

# _ STR __()
Power Management settings. It can be a variable starting with 'pm.

# Setcontinuousmode ()
Set that each axis is constantly updated.

# Setscale (Gauss)
Set the measurement range. The value must be 0.88, 1.3, 1.9, 2.5, 4.0, 4.7, 5.6, or 8.1 Gauss.

# Setdeclination (degrees, minutes = 0)
Sets the magnetic angle compensation in the north direction.

# Getoptions (Register)
Obtains register information, which is usually called by other methods.

# Getdeclination ()
Returns the padding angle of the source image.

# Getdeclinationstring ()
Returns the string format of the True North Magnetic offset compensation.

# Getheading ()
Returns the current point

# Getheadingstring ()
Returns the string format currently pointed.

# Getaxes ()
Returns the direction of each axis.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.