import "github.com/kidoman/embd/sensor/lsm303"
Package lsm303 allows interfacing with the LSM303 magnetometer.
const ( MagHz75 = 0x00 // ODR = 0.75 Hz Mag1Hz5 = 0x04 // ODR = 1.5 Hz Mag3Hz = 0x08 // ODR = 3 Hz Mag7Hz5 = 0x0C // ODR = 7.5 Hz Mag15Hz = 0x10 // ODR = 15 Hz Mag30Hz = 0x14 // ODR = 30 Hz Mag75Hz = 0x18 // ODR = 75 Hz MagNormal = 0x00 // Normal mode MagPositiveBias = 0x01 // Positive bias mode MagNegativeBias = 0x02 // Negative bias mode MagCRADefault = Mag15Hz | MagNormal // 15 Hz and normal mode is the default MagContinuous = 0x00 // Continuous conversion mode MagSingle = 0x01 // Single conversion mode MagSleep = 0x03 // Sleep mode MagMRDefault = MagContinuous // Continuous conversion is the default )
LSM303 represents a LSM303 magnetometer.
New creates a new LSM303 interface. The bus variable controls the I2C bus used to communicate with the device.
Close the sensor data acquisition loop and put the LSM303 into sleep mode.
Heading returns the current heading [0, 360).
Run starts the sensor data acquisition loop.
Package lsm303 imports 5 packages (graph) and is imported by 3 packages. Updated 2016-08-02. Refresh now. Tools for package owners.