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
* Start with the latest version of Raspbian with Wifi configured.
47
+
* Enable SSH, I2C and SPI.
48
+
.. code-block:: shell
49
+
50
+
sudo raspi-config
51
+
52
+
* Update your system to the latest version.
53
+
.. code-block:: shell
54
+
55
+
sudo apt-get update
56
+
sudo apt-get upgrade
57
+
58
+
* Update the python tools
59
+
.. code-block:: shell
60
+
61
+
sudo pip3 install --upgrade setuptools
62
+
(If pip3 is not installed, install it and rerun the command)
63
+
.. code-block:: shell
64
+
sudo apt-get install python3-pip
65
+
* Install the CircuitPython libraries
66
+
.. code-block:: shell
67
+
68
+
pip3 install RPI.GPIO
69
+
pip3 install adafruit-blinka
70
+
pip3 install
71
+
72
+
38
73
Installing from PyPI
39
74
--------------------
40
75
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from
41
76
PyPI <https://pypi.org/project/sparkfun-circuitpython-qwiicjoystick/>`_. To install for current user:
77
+
Installing this library will also install the dependency adafruit-circuitpython-busdevice.
78
+
42
79
43
80
.. code-block:: shell
44
81
@@ -63,6 +100,19 @@ Usage Example
63
100
=============
64
101
* `Qwiic Joystick Hookup Guide <https://learn.sparkfun.com/tutorials/qwiic-joystick-hoookup-guide>`_ - The Arduino examples in the Hookup Guide are available for Python with this library
65
102
* `CircuitPython on a Raspberry Pi <https://learn.adafruit.com/circuitpython-on-raspberrypi-linux>`_ - Basic information on how to install CircuitPython on a Raspberry Pi.
103
+
* Example:
104
+
.. code-block:: shell
105
+
106
+
# import the CircuitPython board and busio libraries
107
+
import board
108
+
import busio
109
+
110
+
# Create bus object using the board's I2C port
111
+
i2c = busio.I2C(board.SCL, board.SDA)
112
+
113
+
joystick = QwiicJoystick(i2c) # default address is 0x20
114
+
# use QwiicJoystick(i2c, address) for a different address
0 commit comments