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:
-
en
NumberEnables GPIO
-
latch
NumberLatch GPIO
-
clear
NumberClears GPIO
-
clk
NumberClock GPIO
-
dat
NumberData out GPIO
-
sw
NumberPush button switch GPIO
-
encA
NumberEncoder A GPIO
-
encB
NumberEncoder B GPIO
-
red
NumberRGB red LED PWM
-
green
NumberRGB green LED PWM
-
blue
NumberRGB blue LED PWM
Returns:
setRingLEDS
-
bits
Parameters:
-
bits
Numberundefined
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:
-
r
NumberRed value; valid values are 0.0-1.0
-
g
NumberGreen value; valid values are 0.0-1.0
-
b
NumberBlue value; valid values are 0.0-1.0