Go Down

Topic: Programmer looking for some hardware/design help (Read 978 times) previous topic - next topic

baldbobbo

Just a bit of background - I'm a C programmer looking to implement a light board similar to this:
http://www.dailycal.org/assets/uploads/2012/04/120410-m-machine-191editlo.jpg

I've already secured an Arduino Uno, and I'd like to utilize a shield from bliptronic that does audio spectrum analyzing:
http://www.bliptronics.com/item.aspx?ItemID=116

So 36 LEDs, preferably able to change color, that move around to the sound of the music inputted. However, at this point, I'm just looking to get a square to light up, so mono-color works for the first iteration - nothing fancy.

I've pretty much written all of the code that handles the various states of LED lights into an integer array - thing is, I just need to get the code to interface with some hardware to output the various patterns. Last time I touched any circuitry was an EE100 class in college about 10 years ago.

Clearly I'm going to need additional hardware, as the Arduino doesn't have 36 outputs -I've read about shift outputting, but I'm not sure where that comes into play with regards to the software.

My question is this - where are some resources that easily explain the following:
1) What parts do I need to increase the available outputs from the default to over 32 outputs?
2) What wiring will be necessary for this? Assuming I'll have to get bread boards.
3) What software changes will be necessary to account for the changes of the output? For example, the usual digitalWrite() is passed a pin, but this won't work - how would I digitalWrite() out the status of the LED to these lights?

I clearly don't want the work done for me, but a little guidance is greatly appreciated. I've been looking around for the last few weeks, and most of the information I get is way over my head.

Thanks!

graynomad

You can use 5 TPIC6B595 shift registers to drive the LEDs. This also means 36 resistors. Or there are versions with constant-current outputs, such as the STP16C596, that will only need a single resistor.

Then there are all sorts of chips designed specifically to drive multiple LEDs, eg AS1108, TLC5947 etc.

As to how this affects your software, that depends on the chip used but let's assume a shift register because they are easier to drive.

You would probably have an array of 5 bytes where the bits correspond to the LEDs.

Code: [Select]

byte led_bits[5];

// some code sets and resets the bits in this array

for (int i = 0; u < 5; i++) {
     shiftOut(dataPin, clockPin, MSBFIRST, led_bits[i]);
}


______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

baldbobbo

Thanks for the feedback!

So I've stubbed out methods for output, so instead of using digitalWrite(pin, HIGH), I would do shiftOut(). However, I don't see definitions of shiftOut() with 4 arguments - what is the 3rd argument that you list?

graynomad

Rob Gray aka the GRAYnomad www.robgray.com

CrossRoads

Forget shiftout();
Use
SPI.transfer

digitalWrite(SSpin,LOW);
SPI.transfer(byte0);
SPI.transfer(byte1);
SPI.transfer(byte2);
SPI.transfer(byte3);
SPI.transfer(byte4);
digitalWrite(SSpin,LOW);

will be wicked fast for updates


Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up