Trying to accessing accelerometer values on sipy with pytracks
-
Hey everyone,
I am trying to use some example code i found to find the accelerometer values on the pytracks. The error reads "File "<stdin>", line 9, in <module> TypeError: function does not take keyword arguments "

I am new to python and am not sure whether the i2c=i2c is correct syntax or if somthing is wrong with the LIS2HH12 library? I also have not updated the pytracks to the latest version but have updated the sipy.
Any help would be appreciated,
Thanks -
You have not included the pysense.py file, place it in lib folder.
from pysense import Pysense #import the file
py = Pysense() #instanciate the object
acc = LIS2HH12(i2c=i2c)
....... -
@chrisi sorry, misread your post. I thought it was pysense you were using and wanting to deepsleep. Now looking at it, I cannot see anything glaringly wrong. I have used similar code to get accelerometer to read correctly on SiPy & PySense board.
-
@thoppe said in Trying to accessing accelerometer values on sipy with pytracks:
LIS2HH12
When instatiating LIS2HH12 there is no keyword parameter i2c.
see the __init__method of the class:
def __init__(self, pysense = None, sda = 'P22', scl = 'P21'):File found here:
https://github.com/pycom/pycom-libraries/blob/master/pytrack/lib/LIS2HH12.pyYou might try to instantiate without any parameters like so (change line 8 to):
acc = LIS2HH12() -
Thanks @this-wiederkehr and @thoppe got it to work using the change
acc = LIS2HH12() -
@bucknall : @chrisi runned into one of your documentation errors: https://docs.pycom.io/pycom_esp32/pycom_esp32/tutorial/includes/pytrack-examples.html#axis-accelerometer
you might adapt the example as mentioned above.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login