This is an old revision of the document!
RGB Tutorial
Resistor Values: For more information on how to identify the value of the resistors we recommend these sites: A nice simple resistor calculator: http://www.ealnet.com/m-eal/resistor/resistor.htm A comprehensive article on identification: http://www.diyaudioandvideo.com/Electronics/Color/
Soldering: If you are new to soldering we recommend the following tutorials: Soldering Basics (http://www.sparkfun.com/tutorials/106) and Soldering Crash Course from the folks at Sparkfun (http://www.sparkfun.com/tutorials/354). How to solder from the Curious Inventor: http://store.curiousinventor.com/guides/How_to_Solder
We assume for these assembly instructions that you know the basics of thru-hole soldering. If you don't check out the links above, these boards are very easy to solder - we promise!
Empty kit (or if using a raw PCB, aquire parts) bag and verify contents. Note for Kickstarter Backers and Pre-orders: Headers are not included in each kit bag, but the entire order came with more than enough headers for all kits.
Solder resistors one at a time. Match the value of resistor with the number written within the resistor outline on the board. Solder the leads and clip off the excess. Repeat for all resistors.
When inserting the LED into the board ensure the longest lead of the LED goes through the hole marked ground - this ensure you ahve the LED oriented properly. Solder the LED leads and clip off the excess.
Cut a length of male headers 6 pins long and one 3 pins long. Insert into corresponding positions (on the bottom of the board) and solder each pin.
Tip: Inseting the headers into a breadboard and then placing the board on top can make this process easier.
Note: If you are using stackable headers, use them here instead of the standard male headers.
Your RGB shield is complete!
Note: The programming sections assumes you've installed the Arduino IDE and the Digispark Add-ons: SoftwareSetup
The RGB shield uses the following pins to control the LEDS: Pin 0 → Red Pin 1 → Green Pin 2 → Blue
Turning a color on or off is as simple as this:
void setup() {
// initialize the LED pins as outputs
pinMode(0, OUTPUT);
pinMode(1, OUTPUT);
pinMode(2, OUTPUT);
}
void loop() {
digitalWrite(0, HIGH); // turn the Red LED On
delay(1000); // wait for a second
digitalWrite(1, HIGH); // turn the Green LED On
delay(1000); // wait for a second
digitalWrite(2, HIGH); // turn the Blue LED On
delay(1000); // wait for a second
digitalWrite(0, LOW); // turn the Red LED off
digitalWrite(1, LOW); // turn the Green LED off
digitalWrite(2, LOW); // turn the Blue LED off
delay(1000); // wait for a second
}
Take a look at the * and * examples for more advanced uses.