simple method to identify which expansion board is being used?
-
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(): -
@philwilkinson
read_hw_versionis 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.
-
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.
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