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

    Easy Way to Tell what Expansion Board is in Use ?

    Scheduled Pinned Locked Moved Expansion Board
    identification
    3 Posts 2 Posters 705 Views 2 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.
    • ahaw021A Offline
      ahaw021
      last edited by

      Is there an easy way to tell which board is in use

      for example i can run sys.platform which gives me FiPy etc

      What I am thinking

      Common Libraries for both

      Main.py
      PySense.py
      PyTrack.py

      Main.py figures out which expansion board it is and then instantiates the relevant python file and runs the code

      Have to program 14 boards which are a mix of pysense and pytracks and was trying to do it in a lazy way

      the hacky way could be to try an I2C address and see if there is a response but if there is a built in method it would be nicer

      Andrei

      L 1 Reply Last reply Reply Quote 0
      • L Offline
        livius @ahaw021
        last edited by

        @ahaw021
        Hi, i did not tried self but try this
        https://github.com/pycom/pycom-libraries/blob/master/lib/pycoproc/pycoproc.py
        there are especially:
        read_hw_version
        read_fw_version
        read_product_id

        think about people first, then computers

        ahaw021A 1 Reply Last reply Reply Quote 0
        • ahaw021A Offline
          ahaw021 @livius
          last edited by

          @livius -- thanks so much

          code i used is below

          from pycoproc import Pycoproc
          expansion_identififer = Pycoproc()
          expansion_identififer.read_product_id()

          looks like:

          Pysense product_id = 61458
          Pytrack product_id = 61459

          I also inserted the Pysense example code after and it runs with no issues which is what I wanted.

          0_1516177983711_290c084a-519f-468b-b05e-ca6a4646c60d-image.png

          0_1516178032059_ede60e62-4e39-44aa-ba38-7c2fd2f53bdc-image.png

          Andrei

          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