RGBRingCoder Class
- 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).

Item Index
Methods
RGBRingCoder
-
en -
latch -
clear -
clk -
dat -
sw -
encA -
encB -
red -
green -
blue
RGBRingCoder constructor
Parameters:
-
enNumberEnables GPIO
-
latchNumberLatch GPIO
-
clearNumberClears GPIO
-
clkNumberClock GPIO
-
datNumberData out GPIO
-
swNumberPush button switch GPIO
-
encANumberEncoder A GPIO
-
encBNumberEncoder B GPIO
-
redNumberRGB red LED PWM
-
greenNumberRGB green LED PWM
-
blueNumberRGB blue LED PWM
Returns:
setRingLEDS
-
bits
Parameters:
-
bitsNumberundefined
getButtonState
()
Boolean
Returns the state of the button
Returns:
True if the button is pressed, false otherwise
getEncoderPosition
()
Number
Returns:
clearEncoderPosition
()
Sets the encoder counter to 0
setRGBLED
-
r -
g -
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.
Parameters:
-
rNumberRed value; valid values are 0.0-1.0
-
gNumberGreen value; valid values are 0.0-1.0
-
bNumberBlue value; valid values are 0.0-1.0