pyupm_rgbringcoder module

class pyupm_rgbringcoder.RGBRingCoder(en, latch, clear, clk, dat, sw, encA, encB, red, green, blue)[source]

Bases: object

API for the SparkFun* RGB RingCoder.

ID: rgbringcoder

Name: RGB RingCoder

Category: led

Link:https://www.sparkfun.com/products/11040

Manufacturer: sparkfun

Connection: pwm gpio RGB RingCoder is a breakout board, a circular LED containing 16 LEDs arranged in a ring, and a rotary encoder. The encoder contains an RGB LED as well as a push button function.

The device requires 11 pins, 3 of which must be PWM-capable (for the RGB LEDs).

C++ includes: rgbringcoder.hpp

clearEncoderPosition()[source]

void clearEncoderPosition()

Sets the encoder counter to 0

getButtonState()[source]

bool getButtonState()

Returns the state of the button

True if the button is pressed, false otherwise

getEncoderPosition()[source]

int getEncoderPosition()

setRGBLED(r, g, b)[source]

void setRGBLED(float r, float g, float b)

Sets the intensity of the red, green, and blue LEDs. Values can be between 0.0 and 1.0. Lower is brighter, higher is dimmer.

r: Red value; valid values are 0.0-1.0

g: Green value; valid values are 0.0-1.0

b: Blue value; valid values are 0.0-1.0

setRingLEDS(bits)[source]

void setRingLEDS(uint16_t bits)