You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*[Google Coral Development Board](https://www.sparkfun.com/products/15318)
24
+
### Supported Platforms
25
+
See the [MicroPython Downloads Page](https://micropython.org/download/?vendor=Sparkfun) for more boards compatible with MicroPython.
26
+
| Python | Platform | Boards |
27
+
|--|--|--|
28
+
| Python | Linux |[Raspberry Pi](https://www.sparkfun.com/raspberry-pi-5-8gb.html) , [NVIDIA Jetson Orin Nano](https://www.sparkfun.com/nvidia-jetson-orin-nano-developer-kit.html) via the [SparkFun Qwiic SHIM](https://www.sparkfun.com/sparkfun-qwiic-shim-for-raspberry-pi.html)|
> The listed supported platforms and boards are the primary platform targets tested. It is fully expected that this package will work across a wide variety of Python enabled systems.
44
34
45
35
Dependencies
46
36
---------------
@@ -51,42 +41,57 @@ Documentation
51
41
-------------
52
42
The SparkFun qwiic I2C module documentation is hosted at [ReadTheDocs](https://qwiic-i2c-py.readthedocs.io/en/latest/index.html)
53
43
54
-
Installation
55
-
---------------
44
+
# Installation
45
+
46
+
The first step to using this package is installing it on your system. The install method depends on the python platform. The following sections outline installation on Python, MicroPython and CircuitPython.
56
47
57
-
### PyPi Installation
58
-
This repository is hosted on PyPi as the [sparkfun-qwiic-i2c](https://pypi.org/project/sparkfun-qwiic-i2c/) package. On systems that support PyPi installation via pip, this library is installed using the following commands
48
+
### Python
59
49
60
-
For all users (note: the user must have sudo privileges):
50
+
#### PyPi Installation
51
+
52
+
The package is primarily installed using the `pip3` command, downloading the package from the Python Index - "PyPi".
53
+
54
+
Note - the below instructions outline installation on a Linux-based (Raspberry Pi) system.
55
+
56
+
First, setup a virtual environment from a specific directory using venv:
61
57
```sh
62
-
sudo pip install sparkfun-qwiic-i2c
58
+
python3 -m venv ~/sparkfun_venv
63
59
```
64
-
For the current user:
60
+
You can pass any path instead of ~/sparkfun_venv, just make sure you use the same one for all future steps. For more information on venv [click here](https://docs.python.org/3/library/venv.html).
Now you should be able to run any example or custom python scripts that have `import qwiic_i2c` by running e.g.:
66
67
```sh
67
-
pip install sparkfun-qwiic-i2c
68
+
~/sparkfun_venv/bin/python3 example_script.py
68
69
```
69
-
## Local Installation
70
-
To install, make sure the setuptools package is installed on the system.
71
70
72
-
Direct installation at the command line:
71
+
### MicroPython Installation
72
+
If not already installed, follow the [instructions here](https://docs.micropython.org/en/latest/reference/mpremote.html) to install mpremote on your computer.
73
+
74
+
Connect a device with MicroPython installed to your computer and then install the package directly to your device with mpremote mip.
73
75
```sh
74
-
python setup.py install
76
+
mpremote mip install github:sparkfun/qwiic_i2c_py
75
77
```
76
78
77
-
To build a package for use with pip:
79
+
### CircuitPython Installation
80
+
If not already installed, follow the [instructions here](https://docs.circuitpython.org/projects/circup/en/latest/#installation) to install CircUp on your computer.
81
+
82
+
Ensure that you have the latest version of the SparkFun Qwiic CircuitPython bundle.
78
83
```sh
79
-
python setup.py sdist
80
-
```
81
-
A package file is built and placed in a subdirectory called dist. This package file can be installed using pip.
84
+
circup bundle-add sparkfun/qwiic_py
85
+
```
86
+
87
+
Finally, connect a device with CircuitPython installed to your computer and then install the package directly to your device with circup.
82
88
```sh
83
-
cd dist
84
-
pip install sparkfun_qwiic_i2c-<version>.tar.gz
89
+
circup install --py qwiic_i2c
85
90
```
86
91
87
92
Examples
88
93
---------------
89
-
This package is used extensively by the python modules for the SparkFun qwiic ecosystem. References to the modules can be found in the [qwiic python package](https://github.com/sparkfun/Qwiic_Py/tree/main/qwiic/drivers)
94
+
This package is used extensively by the python modules for the SparkFun qwiic ecosystem. References to the modules can be found in the [sparkfun-python github topic](https://github.com/topics/sparkfun-python) or in the [drivers directories of Qwiic Py](https://github.com/sparkfun/Qwiic_Py/tree/main/qwiic/drivers).
0 commit comments