I have read some comments in the product pages for the two Illuminated Rotary Encoder ([COM-15141, and [COM-15140) that resister(s) are needed for the LEDs. Perhaps I missed it, but I don’t see any mention of that in any of the supplied documentation. The comments in the provided example code implies no resister should be used for the LEDs.
So how exactly should the builtin LEDs be wired to something like an Adruino UNO?](Rotary Encoder - Illuminated (Red/Green) - COM-15140 - SparkFun Electronics)](Rotary Encoder - Illuminated (RGB) - COM-15141 - SparkFun Electronics)
Resistors are not included inside the encoder for the LEDs, you will need one resistor for each color LED in the encoder, connect the resistor between your Arduino’s digital output pin and the LED pin on the encoder. For resistor values, anything between 150 and 330 ohms would be fine to use. We carry [330 ohm resistors in a pack of 20 if you need some.
You can think of the encoder as three different parts all contained inside one package:
- The encoder
- A RGB LED (or RG LED)
- A button
Arduino has examples for each, you might consider just trying to use the individual parts alone to get comfortable with how they work and then combine them later.
In the documents section of the product page, check the dimensional drawing for a layout of what the individual pins do OR you can solder the encoder to our [encoder breakout board and the silkscreen on that will label each pin for you. :-)](SparkFun Rotary Encoder Breakout - Illuminated (RG/RGB) - BOB-11722 - SparkFun Electronics)](Resistor 330 Ohm 1/4 Watt PTH - 20 pack (Thick Leads) - PRT-14490 - SparkFun Electronics)
These encoders have a common cathode and require resistors, the datasheets shows the forward voltages for each color. If you are looking for a library for this encoder, you can always try https://github.com/Zanduino/RotaryEncoder