Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    Trying to accessing accelerometer values on sipy with pytracks

    Scheduled Pinned Locked Moved Expansion Board
    sipypytrackaccelerometer
    6 Posts 3 Posters 2.2k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C Offline
      chrisi
      last edited by

      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    "
      0_1499063673433_day1.PNG

      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

      T 1 Reply Last reply Reply Quote 0
      • T Offline
        thoppe
        last edited by

        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)
        .......

        1 Reply Last reply Reply Quote 0
        • T Offline
          thoppe @chrisi
          last edited by

          @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.

          1 Reply Last reply Reply Quote 0
          • T Offline
            this.wiederkehr
            last edited by

            @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.py

            You might try to instantiate without any parameters like so (change line 8 to):

            acc = LIS2HH12()

            1 Reply Last reply Reply Quote 1
            • C Offline
              chrisi
              last edited by

              Thanks @this-wiederkehr and @thoppe got it to work using the change
              acc = LIS2HH12()

              T 1 Reply Last reply Reply Quote 0
              • T Offline
                this.wiederkehr @chrisi
                last edited by this.wiederkehr

                @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.

                1 Reply Last reply Reply Quote 0

                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
                • 1 / 1
                • First post
                  Last post

                Pycom on Twitter

                Pycom