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

    simple method to identify which expansion board is being used?

    Scheduled Pinned Locked Moved Expansion Board
    micropythonexpansion boardpytrackpysensepyscan
    3 Posts 3 Posters 296 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.
    • philwilkinsonP Offline
      philwilkinson
      last edited by philwilkinson

      is there a simple micropython method I can call to determine the expansion board/pyscan/pysense/pytrack my pycom devboard is connected to?
      The only option I can think of is to use exception handling. e.g. try py = Pysense():

      J 1 Reply Last reply Reply Quote 0
      • J Offline
        jcaron @philwilkinson
        last edited by

        @philwilkinson read_hw_version is what you need.

        See https://forum.pycom.io/topic/2736/are-there-readable-shield-id-s/3

        Note that this won’t work for the first versions of the expansion board which didn’t have a PIC.

        1 Reply Last reply Reply Quote 0
        • P Offline
          plsecker
          last edited by plsecker

          Same topic: https://forum.pycom.io/topic/2469/easy-way-to-tell-what-expansion-board-is-in-use

          Here's a method to create a generic exp. board object:

          from pycoproc import Pycoproc
          from pysense import Pysense
          from pytrack import Pytrack
          
          # create exp board object using unknown board type
          pyexp = Pycoproc(1)
          
          if pyexp.read_product_id() == 61458:
              print("Using Pysense")
              pyexp = Pysense()
          if pyexp.read_product_id() == 61459:
              print("Using Pytrack")
              pyexp = Pytrack()
          

          Later on use eg:

          if pyexp.board_type == pyexp.PYSENSE:
              si7006 = SI7006A20()
          

          Perhaps someone can tell us the id for the Pyscan board.

          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