pimoroni-encoderwheel


Namepimoroni-encoderwheel JSON
Version 0.0.1 PyPI version JSON
download
home_page
SummaryPython library for the Pimoroni RGB Encoder Wheel
upload_time2023-05-12 10:28:35
maintainer
docs_urlNone
author
requires_python>=3.7
licenseMIT License Copyright (c) 2023 Pimoroni Ltd. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords pi raspberry
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # RGB Encoder Wheel Breakout

[![Build Status](https://img.shields.io/github/actions/workflow/status/pimoroni/encoderwheel-python/test.yml?branch=main)](https://github.com/pimoroni/encoderwheel-python/actions/workflows/test.yml)
[![Coverage Status](https://coveralls.io/repos/github/pimoroni/encoderwheel-python/badge.svg?branch=main)](https://coveralls.io/github/pimoroni/encoderwheel-python?branch=main)
[![PyPi Package](https://img.shields.io/pypi/v/pimoroni-encoderwheel.svg)](https://pypi.python.org/pypi/pimoroni-encoderwheel)
[![Python Versions](https://img.shields.io/pypi/pyversions/pimoroni-encoderwheel.svg)](https://pypi.python.org/pypi/pimoroni-encoderwheel)

RGB Encoder Wheel is a breakout for the ANO directional navigation and scroll wheel rotary encoder. It uses a Nuvoton MS51 microcontroller to read the encoder and direction buttons via I2C, and features a IS31FL3731 LED driver to control a ring of 24 RGB LEDs that surround the encoder.

**Buy it from:** https://shop.pimoroni.com/products/rgb-encoder-wheel-breakout


 Getting the Library

**Stable library only (no examples) from PyPi:**

* Just run `python3 -m pip install pimoroni-encoderwheel`

In some cases you may need to install pip with: `sudo apt install python3-pip`

**Stable library, with latest examples from GitHub:**

* `git clone https://github.com/pimoroni/encoderwheel-python`
* `cd encoderwheel-python`
* `./install.sh`

**Latest/development library and examples from GitHub:**

* `git clone https://github.com/pimoroni/encoderwheel-python`
* `cd encoderwheel-python`
* `./install.sh --unstable`


# Configuring your Raspberry Pi

## Enable I2C

In order to use the Encoder Wheel, you need to enable the I2C interface of your Raspberry Pi. This can be done in the terminal by running:

* `sudo raspi-config nonint do_i2c 0`

Alternatively, you can enable the I2C interface by:
* running `sudo raspi-config` and enabling the option under **Interfacing Options**.
* opening the graphical **Raspberry Pi Configuration** application from the **Preferences** menu.

You may need to reboot after enabling I2C for the change to take effect.


# Examples and Usage

There are various examples to get you started with your Encoder Wheel. With the library installed on your Raspberry Pi, these can be found in the `~/Pimoroni/pimoroni-encoderwheel/examples` directory.

To take Encoder Wheel further, the full API is described in the [library reference](/REFERENCE.md).


# Removing the Library

To uninstall the library only (keeping all examples):

* Just run `python3 -m pip uninstall pimoroni-encoderwheel`

Or if you have grabbed the library from Github:

* `cd encoderwheel-python`
* `./uninstall.sh`

# Reference

## Getting Started

To start coding for your Encoder Wheel breakout, you will need to add the following lines to the start of your code file.

```python
from encoderwheel import EncoderWheel
wheel = EncoderWheel()
```

This will create an `EncoderWheel` class called `wheel` that will be used in the rest of the examples going forward.


## Reading the Buttons

EncoderWheel has five buttons, covering up, down, left, right, and centre. These can be read using the `.pressed(button)` function, which accepts a button number between `0` and `4`. For convenience, each button can be referred to using these constants:

* `UP` = `0`
* `DOWN` = `1`
* `LEFT` = `2`
* `RIGHT` = `3`
* `CENTRE` = `4`

For example, to read the centre button you would write:

```python
centre_state = wheel.pressed(CENTRE)
```

You can also get the number of buttons using the `NUM_BUTTONS` constant.


## Reading the Encoder

Within the directional buttons of the Encoder Wheel breakout is a rotary encoder with 24 counts per revolution.

### Count and Angle

The current count can be read by calling `.count()`. It can also be read back as either the number of `.revolutions()` of the encoder, or the angle in `.degrees()` or `.radians()`.

Be aware that the count is stored as an integer, if it is continually increased or decreased it will eventually wrap at `+2147483647` and `-2147483648`. This will cause a jump in the returned by `.revolutions()`, `degrees()` and `.radians()`, that will need handling by your code.

In practice this will take an extremely long time to reach.


### Count Delta

Often you are not interested in the exact count that the encoder is at, but rather if the count has changed since the last time you checked. This change can be read by calling `.delta()` at regular intervals. The returned value can then be used with a check in code, for the value being non-zero.


### Step and Turn

Sometimes it can be useful to know the encoder's position in the form of which step it is at and how many turns have occurred. The current step can be read by calling `.step()`, which returns a value from `0` to `23`, and the number of turns can be read by calling `.turn()`.

These functions differ from reading the `.count()` or `.revolutions()` by using separate counters, and so avoid the wrapping issue that these functions experience.


### Changing the Direction

The counting direction of an encoder can be changed by calling `.direction(REVERSED_DIR)` at any time in code. The `REVERSED_DIR` constant comes from the `ioexpander.common` module. There is also a `NORMAL_DIR` constant, though this is the default.


### Resetting to Zero

There are times where an encoder's count (and related values) need to be reset back to zero. This can be done by calling `.zero()`.


## LEDs

The Encoder Wheel breakout features 24 RGB LEDs arranged in a ring around the wheel. This is the same number as there are steps on the wheel, letting you use the LEDs to show the current step of the wheel.


### Setting an LED

You can set the colour of a LED on the ring in either the RGB colourspace, or HSV (Hue, Saturation, Value). HSV is useful for creating rainbow patterns.

#### RGB

Set the first LED - `0` - to Purple `255, 0, 255`:

```python
wheel.set_rgb(0, 255, 0, 255)
```

#### HSV

Set the first LED - `0` - to Red `0.0`:

```python
wheel.set_hsv(0, 0.0, 1.0, 1.0)
```


### Clear all LEDs

To turn off all the LEDs, the function `.clear()` can be called. This simply goes through each LED and sets its RGB colour to black, making them emit no light.

This function is useful to have at the end of your code to turn the lights off, otherwise they will continue to show the last colours they were given.


### Showing

Changes to the LEDs do not get applied immediately, due to the amount of I2C communication involved. As such, to have the LEDs show what they have been set to after calling the `.set_rgb()`, `.set_hsv()`, and `.clear()` functions, a specific call to `.show()` needs to be made.


## GPIOs

There are three spare GPIO pins on the edge of Encoder Wheel. These can be used as digital outputs, pwm outputs, digital inputs, and analog inputs.


### Setup

To start using a GPIO pin, first import one of the handy constants used to reference them (see [GPIO Constants](#gpio-constants)). For example, to use the first GPIO pin:

```python
from encoderwheel import GP7
```

Then you need to import the constants for the pin mode to use. These are on the `ioexpander` module that Encoder Wheel is based on.

```python
# For input
from ioexpander import IN  # or IN_PU of a pull-up is wanted

# For output
from ioexpander import OUT

# For PWM
from ioexpander import PWM

# For ADC
from ioexpander import ADC
```


### Mode

With the intended constants imported, the mode of a GPIO pin can be set by calling `.gpio_pin_mode(gpio, mode)`:

```python
wheel.gpio_pin_mode(GP7, <IN or IN_PU or OUT or PWM or ADC>)
```

It is also possible to read the current mode of a GPIO pin by calling `.gpio_pin_mode(gpio)`:

```python
mode = wheel.gpio_pin_mode(GP7)
```


### As Input or ADC

The current value of an GPIO pin in input or ADC mode can be read by calling `.gpio_pin_value(gpio)`:

```python
value = wheel.gpio_pin_value(GP7)
```

If the mode is digital, the value will either be `0` or `1`.
If the mode is analog, the value will be a voltage from `0.0` to `3.3`.


### As Output

The current value of a GPIO pin in output mode can be set by calling `.gpio_pin_value(gpio, value)`:

```python
wheel.gpio_pin_value(GP7, value)
```

The expected value is either `0` or `1`, or `True` or `False`.


### As PWM

The GPIO pins can also be set as PWM outputs. The `PWM` constant can be imported from the `ioexpander` module, and passed into the `.gpio_pin_mode()` function.

The frequency of the PWM signal can then be configured by calling `.gpio_pwm_frequency()`, which accepts a frequency (in Hz). It returns the cycle period, which should be used to set duty cycles.

Finally, the duty cycle of the PWM signal can be set by calling `.gpio_pin_value()` and providing it with a value between `0` and the cycle period.

Below is an example of setting a gpio pin to output a 25KHz signal with a 50% duty cycle:

```python
from ioexpander import PWM
from encoderwheel import EncoderWheel, GP7

# Initialise EncoderWheel
wheel = EncoderWheel()

# Setup the gpio pin as a PWM output
wheel.gpio_pin_mode(GP7, PWM)

# Set the gpio pin's frequency to 25KHz, and record the cycle period
period = wheel.gpio_pwm_frequency(25000)

# Output a 50% duty cycle square wave
wheel.gpio_pin_value(GP7, int(period * 0.5))
```


#### Delayed Loading

By default, changes to a gpio pin's frequency or value are applied immediately. However, sometimes this may not be wanted, and instead you want all pins to receive updated parameters at the same time, regardless of how long the code ran that calculated the update.

For this purpose, `.gpio_pwm_frequency()` and `.gpio_pin_value()` include an optional parameter `load`, which by default is `True`. To avoid this "loading" include `load=False` in the relevant function calls. Then either the last call can include `load=True`, or a specific call to `.gpio_pwm_load()` can be made.

In addition, any function that performs a load, including the `.gpio_pwm_load()` function, can be made to wait until the new PWM value has been sent out of the pins. By default this is disabled, but can be enabled by including `wait_for_load=True` in the relevant function calls.


#### Limitations

All of Encoder Wheel's PWM outputs share the same timing parameters. This means that GP7, GP8, and GP9 share the same frequency. Keep this in mind if changing the frequency of one, as the others will not automatically know about the change, resulting in unexpected duty cycle outputs.


## Function Reference

Here is the complete list of functions available on the `EncoderWheel` class:
```python
EncoderWheel(ioe_address=0x13, led_address=0x77, interrupt_timeout=1.0, interrupt_pin=None, skip_chip_id_check=False)
set_ioe_address(address)
get_interrupt_flag()
clear_interrupt_flag()
pressed(button)
count()
delta()
step()
turn()
zero()
revolutions()
degrees()
radians()
direction()
direction(direction)
set_rgb(index, r, g, b)
set_hsv(index, h, s=1.0, v=1.0)
clear()
show()
gpio_pin_mode(gpio)
gpio_pin_mode(gpio, mode)
gpio_pin_value(gpio)
gpio_pin_value(gpio, value, load=True, wait_for_load=False)
gpio_pwm_load(wait_for_load=True)
gpio_pwm_frequency(frequency, load=True, wait_for_load=True)
```

## Constants Reference

Here is the complete list of constants on the `encoderwheel` module:

### Address Constants

* `DEFAULT_IOE_I2C_ADDR` = `0x13`
* `DEFAULT_LED_I2C_ADDR` = `0x77`
* `ALTERNATE_LED_I2C_ADDR` = `0x74`


### Button Constants

* `UP` = `0`
* `DOWN` = `1`
* `LEFT` = `2`
* `RIGHT` = `3`
* `CENTRE` = `4`


### GPIO Constants

* `GP7` = `7`
* `GP8` = `8`
* `GP9` = `9`
* `GPIOS` = (`7`, `8`, `9`)


### Count Constants

* `NUM_LEDS` = `24`
* `NUM_BUTTONS` = `5`
* `NUM_GPIOS` = `3`

0.0.1
-----

* Initial Release

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "pimoroni-encoderwheel",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "Christopher Parrott <chris@pimoroni.com>, Philip Howard <phil@pimoroni.com>",
    "keywords": "Pi,Raspberry",
    "author": "",
    "author_email": "Christopher Parrott <chris@pimoroni.com>",
    "download_url": "https://files.pythonhosted.org/packages/43/54/660993965065fa71b4209bd05e63327826f6d26495f36d85b397c17b025c/pimoroni_encoderwheel-0.0.1.tar.gz",
    "platform": null,
    "description": "# RGB Encoder Wheel Breakout\n\n[![Build Status](https://img.shields.io/github/actions/workflow/status/pimoroni/encoderwheel-python/test.yml?branch=main)](https://github.com/pimoroni/encoderwheel-python/actions/workflows/test.yml)\n[![Coverage Status](https://coveralls.io/repos/github/pimoroni/encoderwheel-python/badge.svg?branch=main)](https://coveralls.io/github/pimoroni/encoderwheel-python?branch=main)\n[![PyPi Package](https://img.shields.io/pypi/v/pimoroni-encoderwheel.svg)](https://pypi.python.org/pypi/pimoroni-encoderwheel)\n[![Python Versions](https://img.shields.io/pypi/pyversions/pimoroni-encoderwheel.svg)](https://pypi.python.org/pypi/pimoroni-encoderwheel)\n\nRGB Encoder Wheel is a breakout for the ANO directional navigation and scroll wheel rotary encoder. It uses a Nuvoton MS51 microcontroller to read the encoder and direction buttons via I2C, and features a IS31FL3731 LED driver to control a ring of 24 RGB LEDs that surround the encoder.\n\n**Buy it from:** https://shop.pimoroni.com/products/rgb-encoder-wheel-breakout\n\n\n Getting the Library\n\n**Stable library only (no examples) from PyPi:**\n\n* Just run `python3 -m pip install pimoroni-encoderwheel`\n\nIn some cases you may need to install pip with: `sudo apt install python3-pip`\n\n**Stable library, with latest examples from GitHub:**\n\n* `git clone https://github.com/pimoroni/encoderwheel-python`\n* `cd encoderwheel-python`\n* `./install.sh`\n\n**Latest/development library and examples from GitHub:**\n\n* `git clone https://github.com/pimoroni/encoderwheel-python`\n* `cd encoderwheel-python`\n* `./install.sh --unstable`\n\n\n# Configuring your Raspberry Pi\n\n## Enable I2C\n\nIn order to use the Encoder Wheel, you need to enable the I2C interface of your Raspberry Pi. This can be done in the terminal by running:\n\n* `sudo raspi-config nonint do_i2c 0`\n\nAlternatively, you can enable the I2C interface by:\n* running `sudo raspi-config` and enabling the option under **Interfacing Options**.\n* opening the graphical **Raspberry Pi Configuration** application from the **Preferences** menu.\n\nYou may need to reboot after enabling I2C for the change to take effect.\n\n\n# Examples and Usage\n\nThere are various examples to get you started with your Encoder Wheel. With the library installed on your Raspberry Pi, these can be found in the `~/Pimoroni/pimoroni-encoderwheel/examples` directory.\n\nTo take Encoder Wheel further, the full API is described in the [library reference](/REFERENCE.md).\n\n\n# Removing the Library\n\nTo uninstall the library only (keeping all examples):\n\n* Just run `python3 -m pip uninstall pimoroni-encoderwheel`\n\nOr if you have grabbed the library from Github:\n\n* `cd encoderwheel-python`\n* `./uninstall.sh`\n\n# Reference\n\n## Getting Started\n\nTo start coding for your Encoder Wheel breakout, you will need to add the following lines to the start of your code file.\n\n```python\nfrom encoderwheel import EncoderWheel\nwheel = EncoderWheel()\n```\n\nThis will create an `EncoderWheel` class called `wheel` that will be used in the rest of the examples going forward.\n\n\n## Reading the Buttons\n\nEncoderWheel has five buttons, covering up, down, left, right, and centre. These can be read using the `.pressed(button)` function, which accepts a button number between `0` and `4`. For convenience, each button can be referred to using these constants:\n\n* `UP` = `0`\n* `DOWN` = `1`\n* `LEFT` = `2`\n* `RIGHT` = `3`\n* `CENTRE` = `4`\n\nFor example, to read the centre button you would write:\n\n```python\ncentre_state = wheel.pressed(CENTRE)\n```\n\nYou can also get the number of buttons using the `NUM_BUTTONS` constant.\n\n\n## Reading the Encoder\n\nWithin the directional buttons of the Encoder Wheel breakout is a rotary encoder with 24 counts per revolution.\n\n### Count and Angle\n\nThe current count can be read by calling `.count()`. It can also be read back as either the number of `.revolutions()` of the encoder, or the angle in `.degrees()` or `.radians()`.\n\nBe aware that the count is stored as an integer, if it is continually increased or decreased it will eventually wrap at `+2147483647` and `-2147483648`. This will cause a jump in the returned by `.revolutions()`, `degrees()` and `.radians()`, that will need handling by your code.\n\nIn practice this will take an extremely long time to reach.\n\n\n### Count Delta\n\nOften you are not interested in the exact count that the encoder is at, but rather if the count has changed since the last time you checked. This change can be read by calling `.delta()` at regular intervals. The returned value can then be used with a check in code, for the value being non-zero.\n\n\n### Step and Turn\n\nSometimes it can be useful to know the encoder's position in the form of which step it is at and how many turns have occurred. The current step can be read by calling `.step()`, which returns a value from `0` to `23`, and the number of turns can be read by calling `.turn()`.\n\nThese functions differ from reading the `.count()` or `.revolutions()` by using separate counters, and so avoid the wrapping issue that these functions experience.\n\n\n### Changing the Direction\n\nThe counting direction of an encoder can be changed by calling `.direction(REVERSED_DIR)` at any time in code. The `REVERSED_DIR` constant comes from the `ioexpander.common` module. There is also a `NORMAL_DIR` constant, though this is the default.\n\n\n### Resetting to Zero\n\nThere are times where an encoder's count (and related values) need to be reset back to zero. This can be done by calling `.zero()`.\n\n\n## LEDs\n\nThe Encoder Wheel breakout features 24 RGB LEDs arranged in a ring around the wheel. This is the same number as there are steps on the wheel, letting you use the LEDs to show the current step of the wheel.\n\n\n### Setting an LED\n\nYou can set the colour of a LED on the ring in either the RGB colourspace, or HSV (Hue, Saturation, Value). HSV is useful for creating rainbow patterns.\n\n#### RGB\n\nSet the first LED - `0` - to Purple `255, 0, 255`:\n\n```python\nwheel.set_rgb(0, 255, 0, 255)\n```\n\n#### HSV\n\nSet the first LED - `0` - to Red `0.0`:\n\n```python\nwheel.set_hsv(0, 0.0, 1.0, 1.0)\n```\n\n\n### Clear all LEDs\n\nTo turn off all the LEDs, the function `.clear()` can be called. This simply goes through each LED and sets its RGB colour to black, making them emit no light.\n\nThis function is useful to have at the end of your code to turn the lights off, otherwise they will continue to show the last colours they were given.\n\n\n### Showing\n\nChanges to the LEDs do not get applied immediately, due to the amount of I2C communication involved. As such, to have the LEDs show what they have been set to after calling the `.set_rgb()`, `.set_hsv()`, and `.clear()` functions, a specific call to `.show()` needs to be made.\n\n\n## GPIOs\n\nThere are three spare GPIO pins on the edge of Encoder Wheel. These can be used as digital outputs, pwm outputs, digital inputs, and analog inputs.\n\n\n### Setup\n\nTo start using a GPIO pin, first import one of the handy constants used to reference them (see [GPIO Constants](#gpio-constants)). For example, to use the first GPIO pin:\n\n```python\nfrom encoderwheel import GP7\n```\n\nThen you need to import the constants for the pin mode to use. These are on the `ioexpander` module that Encoder Wheel is based on.\n\n```python\n# For input\nfrom ioexpander import IN  # or IN_PU of a pull-up is wanted\n\n# For output\nfrom ioexpander import OUT\n\n# For PWM\nfrom ioexpander import PWM\n\n# For ADC\nfrom ioexpander import ADC\n```\n\n\n### Mode\n\nWith the intended constants imported, the mode of a GPIO pin can be set by calling `.gpio_pin_mode(gpio, mode)`:\n\n```python\nwheel.gpio_pin_mode(GP7, <IN or IN_PU or OUT or PWM or ADC>)\n```\n\nIt is also possible to read the current mode of a GPIO pin by calling `.gpio_pin_mode(gpio)`:\n\n```python\nmode = wheel.gpio_pin_mode(GP7)\n```\n\n\n### As Input or ADC\n\nThe current value of an GPIO pin in input or ADC mode can be read by calling `.gpio_pin_value(gpio)`:\n\n```python\nvalue = wheel.gpio_pin_value(GP7)\n```\n\nIf the mode is digital, the value will either be `0` or `1`.\nIf the mode is analog, the value will be a voltage from `0.0` to `3.3`.\n\n\n### As Output\n\nThe current value of a GPIO pin in output mode can be set by calling `.gpio_pin_value(gpio, value)`:\n\n```python\nwheel.gpio_pin_value(GP7, value)\n```\n\nThe expected value is either `0` or `1`, or `True` or `False`.\n\n\n### As PWM\n\nThe GPIO pins can also be set as PWM outputs. The `PWM` constant can be imported from the `ioexpander` module, and passed into the `.gpio_pin_mode()` function.\n\nThe frequency of the PWM signal can then be configured by calling `.gpio_pwm_frequency()`, which accepts a frequency (in Hz). It returns the cycle period, which should be used to set duty cycles.\n\nFinally, the duty cycle of the PWM signal can be set by calling `.gpio_pin_value()` and providing it with a value between `0` and the cycle period.\n\nBelow is an example of setting a gpio pin to output a 25KHz signal with a 50% duty cycle:\n\n```python\nfrom ioexpander import PWM\nfrom encoderwheel import EncoderWheel, GP7\n\n# Initialise EncoderWheel\nwheel = EncoderWheel()\n\n# Setup the gpio pin as a PWM output\nwheel.gpio_pin_mode(GP7, PWM)\n\n# Set the gpio pin's frequency to 25KHz, and record the cycle period\nperiod = wheel.gpio_pwm_frequency(25000)\n\n# Output a 50% duty cycle square wave\nwheel.gpio_pin_value(GP7, int(period * 0.5))\n```\n\n\n#### Delayed Loading\n\nBy default, changes to a gpio pin's frequency or value are applied immediately. However, sometimes this may not be wanted, and instead you want all pins to receive updated parameters at the same time, regardless of how long the code ran that calculated the update.\n\nFor this purpose, `.gpio_pwm_frequency()` and `.gpio_pin_value()` include an optional parameter `load`, which by default is `True`. To avoid this \"loading\" include `load=False` in the relevant function calls. Then either the last call can include `load=True`, or a specific call to `.gpio_pwm_load()` can be made.\n\nIn addition, any function that performs a load, including the `.gpio_pwm_load()` function, can be made to wait until the new PWM value has been sent out of the pins. By default this is disabled, but can be enabled by including `wait_for_load=True` in the relevant function calls.\n\n\n#### Limitations\n\nAll of Encoder Wheel's PWM outputs share the same timing parameters. This means that GP7, GP8, and GP9 share the same frequency. Keep this in mind if changing the frequency of one, as the others will not automatically know about the change, resulting in unexpected duty cycle outputs.\n\n\n## Function Reference\n\nHere is the complete list of functions available on the `EncoderWheel` class:\n```python\nEncoderWheel(ioe_address=0x13, led_address=0x77, interrupt_timeout=1.0, interrupt_pin=None, skip_chip_id_check=False)\nset_ioe_address(address)\nget_interrupt_flag()\nclear_interrupt_flag()\npressed(button)\ncount()\ndelta()\nstep()\nturn()\nzero()\nrevolutions()\ndegrees()\nradians()\ndirection()\ndirection(direction)\nset_rgb(index, r, g, b)\nset_hsv(index, h, s=1.0, v=1.0)\nclear()\nshow()\ngpio_pin_mode(gpio)\ngpio_pin_mode(gpio, mode)\ngpio_pin_value(gpio)\ngpio_pin_value(gpio, value, load=True, wait_for_load=False)\ngpio_pwm_load(wait_for_load=True)\ngpio_pwm_frequency(frequency, load=True, wait_for_load=True)\n```\n\n## Constants Reference\n\nHere is the complete list of constants on the `encoderwheel` module:\n\n### Address Constants\n\n* `DEFAULT_IOE_I2C_ADDR` = `0x13`\n* `DEFAULT_LED_I2C_ADDR` = `0x77`\n* `ALTERNATE_LED_I2C_ADDR` = `0x74`\n\n\n### Button Constants\n\n* `UP` = `0`\n* `DOWN` = `1`\n* `LEFT` = `2`\n* `RIGHT` = `3`\n* `CENTRE` = `4`\n\n\n### GPIO Constants\n\n* `GP7` = `7`\n* `GP8` = `8`\n* `GP9` = `9`\n* `GPIOS` = (`7`, `8`, `9`)\n\n\n### Count Constants\n\n* `NUM_LEDS` = `24`\n* `NUM_BUTTONS` = `5`\n* `NUM_GPIOS` = `3`\n\n0.0.1\n-----\n\n* Initial Release\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023 Pimoroni Ltd.  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "Python library for the Pimoroni RGB Encoder Wheel",
    "version": "0.0.1",
    "project_urls": {
        "GitHub": "https://www.github.com/pimoroni/encoderwheel-python",
        "Homepage": "https://www.pimoroni.com"
    },
    "split_keywords": [
        "pi",
        "raspberry"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4924c0134b0282d89301ea8d8604f4f74c750df65f93d272da7eb65565e39d7d",
                "md5": "61a28cd69c3b8db45c13932d77b31065",
                "sha256": "5d3928e68091b5ed731d6af7472d887ca435cf0807ac26cec6a382b54ab91efc"
            },
            "downloads": -1,
            "filename": "pimoroni_encoderwheel-0.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "61a28cd69c3b8db45c13932d77b31065",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 18361,
            "upload_time": "2023-05-12T10:28:31",
            "upload_time_iso_8601": "2023-05-12T10:28:31.681127Z",
            "url": "https://files.pythonhosted.org/packages/49/24/c0134b0282d89301ea8d8604f4f74c750df65f93d272da7eb65565e39d7d/pimoroni_encoderwheel-0.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4354660993965065fa71b4209bd05e63327826f6d26495f36d85b397c17b025c",
                "md5": "627f30f92a27a2cbebf7c7e64caef9fc",
                "sha256": "8f097809b407be0d5f56e62429c730d768ddc1555f700c35347c8acd10b8652a"
            },
            "downloads": -1,
            "filename": "pimoroni_encoderwheel-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "627f30f92a27a2cbebf7c7e64caef9fc",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 25535,
            "upload_time": "2023-05-12T10:28:35",
            "upload_time_iso_8601": "2023-05-12T10:28:35.692812Z",
            "url": "https://files.pythonhosted.org/packages/43/54/660993965065fa71b4209bd05e63327826f6d26495f36d85b397c17b025c/pimoroni_encoderwheel-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-12 10:28:35",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "pimoroni",
    "github_project": "encoderwheel-python",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "pimoroni-encoderwheel"
}
        
Elapsed time: 0.06434s