# Rainbowduino problems

**URL:** <https://forum.arduino.cc/t/rainbowduino-problems/39643>\
**Category:** Interfacing\
**Created:** [July 13, 2009, 12:43pm UTC](https://forum.arduino.cc/t/rainbowduino-problems/39643 "2009-07-13T12:43:53Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [July 13, 2009, 12:43pm UTC](https://forum.arduino.cc/t/rainbowduino-problems/39643/1 "2009-07-13T12:43:53Z")

</div>

Hi guys,

Ive just bought a Rainbowduino to control a load of individual LEDs (NOT an RGB matrix). All the documentation so far is aimed towards controlling RGB arrays which is not what I'm after.

Ive connected up 16 LEDs and want to be able to turn each one on and off individually with digitalWrite(). Ive uploaded some demo code to the board which is kind of working. I dont know the numbers of the pins of the board so Im not sure if Im even controlling the correct ones.

Heres a photo of what I have so far: [http://farm3.static.flickr.com/2436/3716019895\_99b95b30c6\_b.jpg](http://farm3.static.flickr.com/2436/3716019895_99b95b30c6_b.jpg)

Can anybody point me in the right direction? Im a bit confused at the moment, my background is programming but I know some basic electronics.

Many thanks,

James.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [July 13, 2009, 12:48pm UTC](https://forum.arduino.cc/t/rainbowduino-problems/39643/2 "2009-07-13T12:48:28Z")

</div>

> uploaded some demo code to the board which is kind of working

And "working" would be...?

Why don't you post your code, then we can advise better.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [July 13, 2009, 12:49pm UTC](https://forum.arduino.cc/t/rainbowduino-problems/39643/3 "2009-07-13T12:49:38Z")

</div>

Ah sorry I forgot to mention, the LEDs are 12v, they dont need any resistors.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [July 13, 2009, 12:56pm UTC](https://forum.arduino.cc/t/rainbowduino-problems/39643/4 "2009-07-13T12:56:47Z")

</div>

Heres the sketch:

```cpp
void setup()                    // run once, when the sketch starts
{
  int i;
  
  for(i = 0; i <=32; i ++)
  {
    pinMode(i, OUTPUT); 
  }
}

void loop()                     // run over and over again
{
  int i;
  
  for(i = 0; i <=32; i ++)
  {
    digitalWrite(i, HIGH); 
    delay(250);
    digitalWrite(i, LOW); 
  }
}

```

I kind of hoped this would make a basic LED chaser, but of course it doesnt. Half the lights just flash on and off randomly.

---

<div class="post-metadata">

**Author:** ![zooto68](https://avatars.discourse-cdn.com/v4/letter/z/5f9b8f/32.png) [@zooto68](https://forum.arduino.cc/u/zooto68)\
**Post date:** [July 13, 2009, 1:40pm UTC](https://forum.arduino.cc/t/rainbowduino-problems/39643/5 "2009-07-13T13:40:18Z")

</div>

> ....they dont need any resistors.

...and let the floodgates open..... :o

---

<div class="post-metadata">

**Author:** ![Grumpy\_Mike](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/grumpy_mike/32/213521_2.png) [@Grumpy\_Mike](https://forum.arduino.cc/u/Grumpy_Mike)\
**Post date:** [July 13, 2009, 2:05pm UTC](https://forum.arduino.cc/t/rainbowduino-problems/39643/6 "2009-07-13T14:05:59Z")

</div>

No Mike he could be right.

If it is 12V across an LED it is entirely likely that there is an internal resistor built in. If not they blow quicker than ..... insert something that blows quickly and won't get censored .... 😉

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [July 13, 2009, 2:13pm UTC](https://forum.arduino.cc/t/rainbowduino-problems/39643/7 "2009-07-13T14:13:17Z")

</div>

Heres a link to the ebay item which I got them from: [http://cgi.ebay.co.uk/ws/eBayISAPI.dll?ViewItem&item=200310953910](http://cgi.ebay.co.uk/ws/eBayISAPI.dll?ViewItem&item=200310953910)

> 50 WHITE 10mm LED'S 12 VOLT OPERATION
> 
> INTENSITY 10000—12000mcd  
> FORWARD VOLTAGE 12volts  
> FORWARD CURRENT 20m/a  
> DOMI WAVELENGTH nm  
> HOUSING WATER CLEAR  
> VIEWING ANGLE 15 degrees  
> THESE LEDS WORK FROM 12 VOLTS NO RESISTOR REQUIRED

So I presume they've got a resistor built in. Anyway, can anybody help me with my pin problem?

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [July 13, 2009, 3:20pm UTC](https://forum.arduino.cc/t/rainbowduino-problems/39643/8 "2009-07-13T15:20:01Z")

</div>

Using just digitalWrite() with the rainbowduino is a bit tricky. 8 of the pins on it are connected to a source driver that can be accessed by digitalWrite(), but I don't know which PORT on the chip is used for that. These usually drive the ROWs of the RGB matrix. The other 24 pins are connected to 3 shift register constant current sink drivers and they can only be accessed using hardware SPI or the shiftout() function.

The best source would be a manual or have a look at the example code. Especially the include file should reveal what you need.

---

<div class="post-metadata">

**Author:** ![retrolefty](https://avatars.discourse-cdn.com/v4/letter/r/dec6dc/32.png) [@retrolefty](https://forum.arduino.cc/u/retrolefty)\
**Post date:** [July 13, 2009, 3:26pm UTC](https://forum.arduino.cc/t/rainbowduino-problems/39643/9 "2009-07-13T15:26:37Z")

</div>

Well first you have to solve the voltage problem. How and what are you using to power the 12vdc LEDs? (it's hard to see from your picture)  
The Arduino digital pins cannot switch 12vdc devices directly, you will need switching transistors between the Arduino's I/O pins and the LEDs to safely switch them on and off. After you have the electrical part correct you/we can deal with the software side. If you had bought just normal LEDs then all you would require is simple current limiting resistor between each Arduino's output pins and it's associated LED, just like the pin 13 built in LED that the blink sketch uses.

Lefty

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [July 13, 2009, 3:33pm UTC](https://forum.arduino.cc/t/rainbowduino-problems/39643/10 "2009-07-13T15:33:02Z")

</div>

Madworm,

Thanks for your reply, ive looked over the sample sketch which came with the the board but im a bit lost. Will take another look though incase something pops out which I missed.

Lefty,

The Rainbowduino is slightly different to a standard Arduino as it has 24 constant current channels of 120mA, 8 super source driver channel of 500mA each and a wide output voltage adaption from 5V-12VDC. So I shouldn't need the transistors ( I think :-? )

---

<div class="post-metadata">

**Author:** ![retrolefty](https://avatars.discourse-cdn.com/v4/letter/r/dec6dc/32.png) [@retrolefty](https://forum.arduino.cc/u/retrolefty)\
**Post date:** [July 13, 2009, 4:13pm UTC](https://forum.arduino.cc/t/rainbowduino-problems/39643/11 "2009-07-13T16:13:25Z")

</div>

OK, I was not considering other then standard Arduion I/O pins.

Lefty

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [July 13, 2009, 4:48pm UTC](https://forum.arduino.cc/t/rainbowduino-problems/39643/12 "2009-07-13T16:48:38Z")

</div>

Right, ive worked out which pins correspond to the 8 source channels. These pins can be easily turned on or off with digitalWrite();

VCC 1 - pin 10  
VCC 2 - pin 9  
VCC 3 - pin 8  
VCC 4 - pin 7  
VCC 5 - pin 6  
VCC 6 - pin 5  
VCC 7 - pin 4  
VCC 8 - pin 3

Now ive just got to work out how to get the RGB channels working as I want :🙂

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [July 15, 2009, 11:40am UTC](https://forum.arduino.cc/t/rainbowduino-problems/39643/13 "2009-07-15T11:40:28Z")

</div>

Im still stuck on this. I just cant work out how the shift register works. Ive looked over the arduino docs, the rainbowduino sample sketch and played around with shiftOut but I just cant get anything to work.

Maybe this was a bit too big to be taking on as my first Arduino project 😢

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [July 15, 2009, 3:53pm UTC](https://forum.arduino.cc/t/rainbowduino-problems/39643/14 "2009-07-15T15:53:30Z")

</div>

Woop, ive got this working now thanks to the example Seeedstudio posted on their blog yesterday: [http://www.seeedstudio.com/blog/?p=512](http://www.seeedstudio.com/blog/?p=512)

Thanks for all the other help guys.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [April 21, 2010, 7:18pm UTC](https://forum.arduino.cc/t/rainbowduino-problems/39643/15 "2010-04-21T19:18:14Z")

</div>

Guys!  
Would write a code what to include it all!?  
Thanks

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [April 21, 2010, 10:20pm UTC](https://forum.arduino.cc/t/rainbowduino-problems/39643/16 "2010-04-21T22:20:39Z")

</div>

Code.. include.. would?...  
I'm sorry, I can't understand a single thing you're trying to say / ask :-/  
I doubt others would be able to...

Perhaps there is a forum dedicated to your native language?  
If so, I'd suggest asking there in your native tongue.

---

<div class="post-metadata">

**Author:** ![MarkT](https://avatars.discourse-cdn.com/v4/letter/m/c89c15/32.png) [@MarkT](https://forum.arduino.cc/u/MarkT)\
**Post date:** [April 22, 2010, 11:24am UTC](https://forum.arduino.cc/t/rainbowduino-problems/39643/17 "2010-04-22T11:24:31Z")

</div>

> I dont know the numbers of the pins of the board so Im not sure if Im even controlling the correct ones.

and

> I kind of hoped this would make a basic LED chaser, but of course it doesnt. Half the lights just flash on and off randomly.

So you need to make sure you are driving the right pins in the order you intend, or how else can you expect all the LEDs to come on in the right sequence?

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 6, 2021, 7:58pm UTC](https://forum.arduino.cc/t/rainbowduino-problems/39643/18 "2021-05-06T19:58:49Z")

</div>


