123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
-
-
-
-
-
-
-
-
-
- targetPlatform = None
-
- def isPi():
- global targetPlatform
-
- if targetPlatform == None:
- getTarget()
-
- return targetPlatform == "pi"
-
- def isPico():
- global targetPlatform
-
- if targetPlatform == None:
- getTarget()
-
- return targetPlatform == "pico"
-
- def getTarget():
- global targetPlatform
-
- target = None
- try:
-
- from pi import PiMatrix
- pi = PiMatrix()
-
-
- from mapper import MapperColorAdjust, MapperStripToRect
- col = MapperColorAdjust(pi)
- target = MapperStripToRect(col)
-
- if targetPlatform == None:
-
- print("Raspberry Pi Adafruit RGB LED Matrix detected")
- targetPlatform = "pi"
- except:
- try:
-
- from pico import PicoMatrix
- target = PicoMatrix()
-
- if targetPlatform == None:
-
- print("Raspberry Pi Pico Interstate75 RGB LED Matrix detected")
- targetPlatform = "pico"
- except:
-
- from test import TestGUI
- target = TestGUI()
-
- if targetPlatform == None:
-
- print("Falling back to GUI debug interface")
- targetPlatform = "tk"
-
- return target
|