Skip to content
This repository was archived by the owner on Oct 25, 2019. It is now read-only.

LSM303.set_mag_gain does not refer instantiated object #5

Closed
ggoetz opened this issue Nov 13, 2017 · 2 comments
Closed

LSM303.set_mag_gain does not refer instantiated object #5

ggoetz opened this issue Nov 13, 2017 · 2 comments

Comments

@ggoetz
Copy link

ggoetz commented Nov 13, 2017

LSM303.set_mag_gain does not refer instantiated object.

Consequently, the following code fails:
lsm303 = Adafruit_LSM303.LSM303()
lsm303.set_mag_gain(gain=0x80)
with a TypeError: set_mag_gain() got multiple values for argument 'gain'

Changing line 88 of LSM303.py from:
def set_mag_gain(gain=LSM303_MAGGAIN_1_3):
to
def set_mag_gain(self, gain=LSM303_MAGGAIN_1_3):
fixes the issue.

@ggoetz
Copy link
Author

ggoetz commented Nov 13, 2017

Pull request #3 fixes the issue.

@siddacious
Copy link
Contributor

Thank you.

This library has been replaced by two new libraries, one for each sensor in the LSM303DLH:

https://github.com/adafruit/Adafruit_CircuitPython_LSM303_Accel
https://github.com/adafruit/Adafruit_CircuitPython_LSM303DLH_Mag

Your specific feedback isn't relevant to the new library but thank you for taking the time to point it out.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants