You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.4 KiB

  1. Introduction
  2. ============
  3. This library provides best-guess platform detection for a range of single-board
  4. computers and (potentially) other platforms. It's intended for use in
  5. `Adafruit_Blinka <https://github.com/adafruit/Adafruit_Blinka>`_, but may be
  6. useful in other contexts.
  7. The API is currently unstable and may change drastically in future releases.
  8. Installation
  9. ============
  10. On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from
  11. PyPI <https://pypi.org/project/adafruit-circuitpython-motorkit/>`_. To install for current user:
  12. .. code-block:: shell
  13. pip3 install Adafruit-PlatformDetect
  14. To install system-wide (this may be required in some cases):
  15. .. code-block:: shell
  16. sudo pip3 install Adafruit-PlatformDetect
  17. To install in a virtual environment in your current project:
  18. .. code-block:: shell
  19. mkdir project-name && cd project-name
  20. python3 -m venv .env
  21. source .env/bin/activate
  22. pip3 install Adafruit-PlatformDetect
  23. Usage
  24. =====
  25. .. code-block:: python
  26. from adafruit_platformdetect import Detector
  27. detector = Detector()
  28. print("Chip id: ", detector.chip.id)
  29. print("Board id: ", detector.board.id)
  30. # Check for specific board models:
  31. print("Pi 3B+? ", detector.board.RASPBERRY_PI_3B_PLUS)
  32. print("BBB? ", detector.board.BEAGLEBONE_BLACK)
  33. print("Orange Pi PC? ", detector.board.ORANGE_PI_PC)
  34. print("generic Linux PC? ", detector.board.GENERIC_LINUX_PC)