Skip to main content

CircuitPython library for Sparkfun Qwiic Joystick

Project description

Introduction

Documentation Status Discord Build Status

CircuitPython library for Sparkfun Qwiic Joystick. This library is ported from the SparkFun Qwiic Joystick Arduino Library

SparkFun Qwiic Joystick (COM-15168)

SparkFun Qwiic Joystick (COM-15168)

Dependencies

This driver depends on:

Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle.

Raspberry Pi Setup

Adafruit has an excellent tutorial on Installing CircuitPython Libraries on Raspberry Pi.

Quick Start Summary:

  • Start with the latest version of Raspbian with Wifi configured.

  • Enable SSH, I2C and SPI.

sudo raspi-config
  • Update your system to the latest version.

sudo apt-get update
sudo apt-get upgrade
  • Update the python tools

sudo pip3 install --upgrade setuptools

(If pip3 is not installed, install it and rerun the command)

sudo apt-get install python3-pip
  • Install the CircuitPython libraries

pip3 install RPI.GPIO
pip3 install adafruit-blinka

Installing from PyPI

On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally from PyPI.

Installing this library will also install the dependency adafruit-circuitpython-busdevice.

To install for current user:

pip3 install sparkfun-circuitpython-qwiicjoystick

To install system-wide (this may be required in some cases):

sudo pip3 install sparkfun-circuitpython-qwiicjoystick

To install in a virtual environment in your current project:

mkdir project-name && cd project-name
python3 -m venv .env
source .env/bin/activate
pip3 install sparkfun-circuitpython-qwiicjoystick

Usage Example

# import the CircuitPython board and busio libraries
import board
import busio

# Create bus object using the board's I2C port
i2c = busio.I2C(board.SCL, board.SDA)

joystick = QwiicJoystick(i2c)  # default address is 0x20

# use QwiicJoystick(i2c, address) for a different address
# joystick = QwiicJoystick(i2c, 0x21)"""

Contributing

Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.

Building locally

Zip release files

To build this library locally you’ll need to install the circuitpython-build-tools package.

python3 -m venv .env
source .env/bin/activate
pip install circuitpython-build-tools

Once installed, make sure you are in the virtual environment:

source .env/bin/activate

Then run the build:

circuitpython-build-bundles --filename_prefix sparkfun-circuitpython-qwiicjoystick --library_location .

Sphinx documentation

Sphinx is used to build the documentation based on rST files and comments in the code. First, install dependencies (feel free to reuse the virtual environment from above):

python3 -m venv .env
source .env/bin/activate
pip install Sphinx sphinx-rtd-theme

Now, once you have the virtual environment activated:

cd docs
sphinx-build -E -W -b html . _build/html

This will output the documentation to docs/_build/html. Open the index.html in your browser to view them. It will also (due to -W) error out on any warning like Travis will. This is a good way to locally verify it will pass.

License Information

This product is open source!

Please review the LICENSE.md file for license information.

Please use, reuse, and modify these files as you see fit.

Please maintain the attributions to SparkFun Electronics and Adafruit and release any derivative under the same license.

Distributed as-is; no warranty is given.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sparkfun-circuitpython-qwiicjoystick-1.0.2.tar.gz (24.1 kB view details)

Uploaded Source

File details

Details for the file sparkfun-circuitpython-qwiicjoystick-1.0.2.tar.gz.

File metadata

  • Download URL: sparkfun-circuitpython-qwiicjoystick-1.0.2.tar.gz
  • Upload date:
  • Size: 24.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.7

File hashes

Hashes for sparkfun-circuitpython-qwiicjoystick-1.0.2.tar.gz
Algorithm Hash digest
SHA256 1703ff743f3b561396e5bafc9df722a0b452b992aeb29c6e454aa28df142184c
MD5 6967a95b80a49dda9a373477dd372417
BLAKE2b-256 96541f43e2e4e534a275147dcca0ec5b55c45e3e74f3074fee38d671358cdec1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page