Trying to accessing accelerometer values on sipy with pytracks
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,
@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.
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'):
You might try to instantiate without any parameters like so (change line 8 to):
acc = LIS2HH12()
@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.
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)