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():
-
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.
-
@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.