Rainbowduino problems

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

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.

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.

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

Heres the sketch:

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.

....they dont need any resistors.

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

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 .... :wink:

Heres a link to the ebay item which I got them from: 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?

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.

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

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 :-? )

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

Lefty

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 ::slight_smile:

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 :cry:

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

Thanks for all the other help guys.

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

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.

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?