First program... Charlieplexing/multiplexing 156

156 LEDS.

So, I browsed the forum a bit and found this thread,
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1216055823/6

And found this little snippet,

unsigned char cathodes[72] = {1,2,3,4,5,6,7,8,9, 0,2,3,4,5,6, ...};
unsigned char anodes[72] =   {0,0,0,0,0,0,0,0,0, 1,1,1,1,1,1,...};

void light_cp_led(unsigned char N)
{
  static unsigned char last_n;
  pinMode(cathodes[last_n], INPUT);  // turn off previous LED
  pinMode(anodes[last_n], INPUT);  // on both ends
  pinMode(cathodes[n], OUTPUT);  // turn on new LED cathode
  digitalWrite(cathodes[n], LOW);
  pinMode(anodes[n], OUTPUT);  // turn on new LED annode
  digitalWrite(anodes[n], HIGH);
}

Now the guy who posted it went on to say it was untested and wouldn't work, but surely something along these lines must be possible to reduce the amount of code that needs to be written?

Now I tried to modify it to my liking (156 LEDS, wrote all the cathode/anode pins), now I'm a complete (and I mean complete) software/programming noob. I have absolutely no idea what these things mean, or what the errors that are returned means.

It says "in Function main, undefined reference to 'loop'

Now from what I understand, loop is just the what the program will run and keep running when it's executed, correct?
setup is the initial values, like what pin numbers are what.

Well maybe before we get going too far in depth with this, is this code possible to use with the Arduino and will it be able to drive my 156 LEDS?

Thanks in advance!

Let's summarize a little bit,

  1. Think there's a way to modify the code above to make it work for driving 156 LEDS?

  2. Where is a good crash course in C++ for a complete noob? I don't really want to keep pestering you guys, and I'm sure if I read through some stuff I might be able to get a slight hold on what I'm actually doing.

Looks like something I posted a while ago...

It says "in Function main, undefined reference to 'loop'

You haven't gotten to the point where my code snippet "won't work"; you still need to learn some of the basic Arduino programming principles. In particular, the code is a sort of skeleton of a SUBROUTINE that could be added to a arduino sketch to do the mapping of "led numbers" to pin settings. You still need the rest of the sketch, including the "setup" and "loop" functions that are the basic core of any sketch.

I swear, after I retire, I'm going to write a book on how to do nothing but make "blinking lights." :slight_smile:

It is something you posted a while ago!

Heh, but let me get what you're saying straight.

So this little bugger of code is going to look at the original states of the LEDs (say pin 0 high pin 1 low pin 2/3/4/5/ input), then it will go through and change these values and cycle through with the n previous?

Also I notice there isn't a time delay, which is where the loop function comes in?

What more could there be to modify the changing of the lights though, the way it looks to me should be sufficient to cycle through. (I know it's not, but why?)

So let me take a guess at where I need to go next, I need to make a loop of all the original values, then call the function void light_cp_light to go through and change all the values of the loop, and then just keep doing that (but it's a loop so it'll automatically go through and redo the action again and again???????)

Thanks in advance.

Think you could give me a nudge into the right direction? I'll need to use PROGMEM as it's a char right?

So just to understand,
I set initial values, I call upon your function to come in and switch it up, it stores these new values in progmem???

:confused: I'm pretty lost.......

OK, let's see here.
To light an LED, one has to set its anode to HIGH, and its cathode to LOW (with a resistor in there to keep power levels safe.)

For a single LED, one typically connects one side of the LED to a power connection, and the other side to a pin.

For a string of LEDs, you can waste pins by using some of them as power pins for the LEDs; you just set the pins LOW in the setup() function (evil example with Bare Bones Board and no resistors:)

In multiplexing, you connect rows and columns of LEDs together, and then set the row pin HIGH and the column pin LOW. OFF pins will have both pins HIGH or both pins LOW. There's a nice mathematical relationship between a particular LED's position and which pins are anodes and cathodes. You can light a whole row of LEDs at once, as long as you've paid attention to power considerations...

Charlieplexing is like multiplexing, except OFF LEDs will have one pin set as INPUTS, and it's more complicated to figure out which pins go with which LED. There's been a suggestion that you can only light one LED at a time with charlieplexing, and a conflicting opinion that you can light a whole row.

The code snippet I posted previously doesn't do ANY "cycling." It just lights a single LED by:

  1. turning off the LED that used to be on. (this should result in all pins being set to INPUT, and it relies on being the only function used to turn on LEDs.
  2. map the "led number" into a pin number for the anode and cathode of THAT LED. This is what the big arrays are for; they provide a very general translation: in goes an LED number, out comes a cathode or anode pin number... The arrays would only need to be in PROGMEM because of their size.
  3. turn on that new LED.

To get it to scan/cycle in a complete sketch, you'd need a setup() function to initialize things, and a loop() function that does the actual cycling, something like:

void loop()
{
  delay( delayTime);  // Wait
  whichled += 1;  // Pick next led
  if (whichled >= totalLEDS) { // Did we run out of LEDs?
    whichled = 0;  // If so, go back to first LED.
  }
  light_cp_led(whichled) // light new led.
}

As another example, here is the COMPLETE and TESTED code that runs the string of LEDs form the photo above, which uses a similar array for mapping which LEDs are on.

/*
 * Scan a set of LEDs plugged into the digital output pins.
 * Some pins are used as "power" pins for the LEDs (set to GND in setup)
 * and some are used to turn the LEDs on and off.
 */
 
byte ground_pins[] = { 
  12, 10, 8, 6, 4};
byte led_pins[] = {
  13, 11, 9, 7, 5, 3};
long delayTime = 100;
byte whichled = 0;
byte lastled = 0;

void light_one_led(byte lednum)
{
  digitalWrite(led_pins[lastled], LOW); // turn off old led
  lastled = lednum; // remember
  digitalWrite(led_pins[lednum], HIGH); // turn on new led
}

void setup()
{
  byte i;

  for (i=0; i < sizeof(ground_pins); i++) {  // set all Ground pins LOW
    pinMode(ground_pins[i], OUTPUT);
    digitalWrite(ground_pins[i], LOW);
  }
  for (i=0; i < sizeof(led_pins); i++) {  // Set all LED pins as outputs (and off)
    pinMode(led_pins[i], OUTPUT);
    digitalWrite(led_pins[i], LOW);
  }
}

void loop()
{
  delay( delayTime);  // Wait
  whichled += 1;  // Pick next led
  if (whichled >= sizeof(led_pins)) { // Did we run out of LEDs?
    whichled = 0;  // If so, go back to first LED.
  }
  light_one_led(whichled);
}

Okay sounds great, thanks for the help so far. I will try it and report back at 12-1 am.

Okay, maybe not so long.
As I'm toying with it, I keep getting the error variable or field 'light_cp_led' declared void in function void loop.

I have been googling for a while, but nothing that comes up is helping. A couple suggestions were to put the function that's called before loop(), but that didn't help.

Any suggestions?

Also, there isn't any progmem in this code so I am guessing that the unsigned char cathodes[156] is what gets sent to the prog mem (the long list of numbers after that)?

Then unsigned char cathodes is what gets called when it wants to see what the next n value is?

#include <avr/io.h>
#include <avr/pgmspace.h> 
    
   unsigned char cathodes[156] PROGMEM = {1,2,3,4,5,6,7,8,9,10,11,12, 0,2,3,4,5,6,7,8,9,10,11,12, 0,1,3,4,5,6,7,8,9,10,11,12, 0,1,2,4,5,6,7,8,9,10,11,12, 0,1,2,3,5,6,7,8,9,10,11,12, 0,1,2,3,4,6,7,8,9,10,11,12, 0,1,2,3,4,5,7,8,9,10,11,12, 0,1,2,3,4,5,6,8,9,10,11,12, 0,1,2,3,4,5,6,7,9,10,11,12, 0,1,2,3,4,5,6,7,8,10,11,12, 0,1,2,3,4,5,6,7,8,9,11,12, 0,1,2,3,4,5,6,7,8,9,10,12, 0,1,2,3,4,5,6,7,8,9,10,11,};

   unsigned char anodes[156] PROGMEM = {0,0,0,0,0,0,0,0,0,0,0,0, 1,1,1,1,1,1,1,1,1,1,1,1, 2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,3,3,3,3, 4,4,4,4,4,4,4,4,4,4,4,4, 5,5,5,5,5,5,5,5,5,5,5,5, 6,6,6,6,6,6,6,6,6,6,6,6, 7,7,7,7,7,7,7,7,7,7,7,7, 8,8,8,8,8,8,8,8,8,8,8,8, 9,9,9,9,9,9,9,9,9,9,9,9, 10,10,10,10,10,10,10,10,10,10,10,10, 11,11,11,11,11,11,11,11,11,11,11,11, 12,12,12,12,12,12,12,12,12,12,12,12,};


int pin0 = 0;
int pin1 = 1;
int pin2 = 2;
int pin3 = 3;
int pin4 = 4;
int pin5 = 5;
int pin6 = 6;
int pin7 = 7;
int pin8 = 8;
int pin9 = 9;
int pin10 = 10;
int pin11 = 11;
int pin12 = 12;
int time = 500;
int totalLEDS = 156;
int n = 0;
int whichled = 0;
int last_n = 0;



void setup(){
  pinMode(0, INPUT);
  pinMode(1, INPUT);
  pinMode(2, INPUT);
  pinMode(3, INPUT);
  pinMode(4, INPUT);
  pinMode(5, INPUT);
  pinMode(6, INPUT);
  pinMode(7, INPUT);
  pinMode(8, INPUT);
  pinMode(9, INPUT);
  pinMode(10, INPUT);
  pinMode(11, INPUT);
  pinMode(12, INPUT);         
}

void light_cp_led(whichled){
  
  static unsigned char n;
  pinMode(cathodes[last_n], INPUT);  // turn off previous LED
  pinMode(anodes[last_n], INPUT);  // on both ends
  pinMode(cathodes[n], OUTPUT);  // turn on new LED cathode
  digitalWrite(cathodes[n], LOW);
  pinMode(anodes[n], OUTPUT);  // turn on new LED anode
  digitalWrite(anodes[n], HIGH);
  last_n = n;
}

void loop()
{
  delay(time);  // Wait
  whichled += 1;  // Pick next led
  if (whichled >= sizeof(totalLEDS)) { // Did we run out of LEDs?
    whichled = 0;  // If so, go back to first LED.
  }
  light_one_led(whichled);
}

That's what I have so far, now it's giving me an error "expected unqualified-id before numeric constant in function 'void loop()'

So where is the best place to find help for this stuff, I would prefer to not continually ask questions here, but google is NOT very helpful for this stuff....

I don't think I'll ever be a programmer....

EDIT AGAIN:

Got most of the stuff going (it goes through separately, but when I combine it all into one package it won't go through).

The error I get now is variable or field ... declared void in Function void loop().

How can I rid the code of this bugger?

Okay! One of my buddies helped me out, this is the code I end up with which WORKS. Except I have some shorts in my wires :/, and can't find them!!!!! Will using an oscilloscope help me pin point the location of shorts (I think there's quite a few of them, but I think my solder joints are good, didn't have shorts before!).

#include <avr/io.h>
#include <avr/pgmspace.h>
  
   unsigned char cathodes[156]  PROGMEM = {1,2,3,4,5,6,7,8,9,10,11,12, 0,2,3,4,5,6,7,8,9,10,11,12, 0,1,3,4,5,6,7,8,9,10,11,12, 0,1,2,4,5,6,7,8,9,10,11,12, 0,1,2,3,5,6,7,8,9,10,11,12, 0,1,2,3,4,6,7,8,9,10,11,12, 0,1,2,3,4,5,7,8,9,10,11,12, 0,1,2,3,4,5,6,8,9,10,11,12, 0,1,2,3,4,5,6,7,9,10,11,12, 0,1,2,3,4,5,6,7,8,10,11,12, 0,1,2,3,4,5,6,7,8,9,11,12, 0,1,2,3,4,5,6,7,8,9,10,12, 0,1,2,3,4,5,6,7,8,9,10,11,};

   unsigned char anodes[156]  PROGMEM = {0,0,0,0,0,0,0,0,0,0,0,0, 1,1,1,1,1,1,1,1,1,1,1,1, 2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,3,3,3,3, 4,4,4,4,4,4,4,4,4,4,4,4, 5,5,5,5,5,5,5,5,5,5,5,5, 6,6,6,6,6,6,6,6,6,6,6,6, 7,7,7,7,7,7,7,7,7,7,7,7, 8,8,8,8,8,8,8,8,8,8,8,8, 9,9,9,9,9,9,9,9,9,9,9,9, 10,10,10,10,10,10,10,10,10,10,10,10, 11,11,11,11,11,11,11,11,11,11,11,11, 12,12,12,12,12,12,12,12,12,12,12,12,};


int pin0 = 0;
int pin1 = 1;
int pin2 = 2;
int pin3 = 3;
int pin4 = 4;
int pin5 = 5;
int pin6 = 6;
int pin7 = 7;
int pin8 = 8;
int pin9 = 9;
int pin10 = 10;
int pin11 = 11;
int pin12 = 12;
int time = 125;
int totalLEDS = 156;
int n = 0;
int whichled = 0;
int last_n = 0;
int pickone = 0;


void setup(){
  pinMode(0, INPUT);
  pinMode(1, INPUT);
  pinMode(2, INPUT);
  pinMode(3, INPUT);
  pinMode(4, INPUT);
  pinMode(5, INPUT);
  pinMode(6, INPUT);
  pinMode(7, INPUT);
  pinMode(8, INPUT);
  pinMode(9, INPUT);
  pinMode(10, INPUT);
  pinMode(11, INPUT);
  pinMode(12, INPUT);  
 
}



void light_cp_led(int whichone){
 
  static unsigned char last_n = 0;

  pinMode(cathodes[last_n], INPUT);  // turn off previous LED
  pinMode(anodes[last_n], INPUT);  // on both ends
  pinMode(cathodes[whichone], OUTPUT);  // turn on new LED cathode
  digitalWrite(cathodes[whichone], LOW);
  pinMode(anodes[whichone], OUTPUT);  // turn on new LED anode
  digitalWrite(anodes[whichone], HIGH);
  last_n = whichone;

}


void loop()
{
 static unsigned char whichled = 0;
 delay(time);  // Wait
 light_cp_led(whichled);
 whichled += 1;  // Pick next led
 if (whichled >= totalLEDS) { // Did we run out of LEDs?
   whichled = 0;  // If so, go back to first LED.
 }
}

here's the wires

Can't find the shorts!!!!!

Okay............................................................

So I have some shorts, no biggie. I switched the code to flash really quickly, and it goes now.

But as I came back today and tried to switch it to something slower, it no longer wants to upload. I didn't change ANYTHING.

It gives me the good ole
avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

Same thing I got with the board that broke. It seemed like the reset button was getting a little sluggish and wasn't doing what it was supposed to last night, and now here we are, no longer will it accept an upload.

Decimalia, windows Vista.

Interesting... That message usually means that you have selected the wrong COM port from Tools/Serial Port. This can easily happen in windows if, say, you plug the cable into a different USB port. Windows assigns a new port name and the old one doesn't work anymore.

Mikal

Okay fellas, we have mixed news!

The good! I got it to upload again, i found my short in the whole thing (had to leave ~10 leds disconnected due to the short!)

Here's a video, and it will help to visualize the problem that I explain below.
When the video goes black, that's when there is only a couple lights that light up very dimly.

The bad- Well only about 1/2 or less than that LEDS are actually lighting up....

I realized another problem with the programming though, and that was that I actually had 14 sets of wires, giving me a total of 182 leds.

After a while of the program running, it will hang in a spot. It is generally the same spot (the same lights light up).

Only one light should be on at a time, not really sure why there's a lot of them (could be a short, but I tested for conductivity, is there any modifications that could be made in the programming?)
the
I think the program gets confused or overloaded after a while, it stops and only a HARD reboot (unplug and replug) will solve the problem. If I hit reset the leds stop flickering and go solid, but then when I let go they go back to flickering.

This is the final code that I'm using at the moment;

#include <avr/io.h>
#include <avr/pgmspace.h>

   unsigned char cathodes[182]  PROGMEM = {1,2,3,4,5,6,7,8,9,10,11,12,13, 0,2,3,4,5,6,7,8,9,10,11,12,13, 0,1,3,4,5,6,7,8,9,10,11,12,13, 0,1,2,4,5,6,7,8,9,10,11,12,13, 0,1,2,3,5,6,7,8,9,10,11,12,13, 0,1,2,3,4,6,7,8,9,10,11,12,13, 0,1,2,3,4,5,7,8,9,10,11,12,13, 0,1,2,3,4,5,6,8,9,10,11,12,13, 0,1,2,3,4,5,6,7,9,10,11,12,13, 0,1,2,3,4,5,6,7,8,10,11,12,13, 0,1,2,3,4,5,6,7,8,9,11,12,13, 0,1,2,3,4,5,6,7,8,9,10,12,13, 0,1,2,3,4,5,6,7,8,9,10,11,13, 0,1,2,3,4,5,6,7,8,9,10,11,12};

   unsigned char cathodes[182]  PROGMEM = {0,0,0,0,0,0,0,0,0,0,0,0,0, 1,1,1,1,1,1,1,1,1,1,1,1,1, 2,2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,3,3,3,3,3, 4,4,4,4,4,4,4,4,4,4,4,4,4, 5,5,5,5,5,5,5,5,5,5,5,5,5, 6,6,6,6,6,6,6,6,6,6,6,6,6, 7,7,7,7,7,7,7,7,7,7,7,7,7, 8,8,8,8,8,8,8,8,8,8,8,8,8, 9,9,9,9,9,9,9,9,9,9,9,9,9, 10,10,10,10,10,10,10,10,10,10,10,10,10, 11,11,11,11,11,11,11,11,11,11,11,11,11, 12,12,12,12,12,12,12,12,12,12,12,12,12, 13,13,13,13,13,13,13,13,13,13,13,13,13};


int pin0 = 0;
int pin1 = 1;
int pin2 = 2;
int pin3 = 3;
int pin4 = 4;
int pin5 = 5;
int pin6 = 6;
int pin7 = 7;
int pin8 = 8;
int pin9 = 9;
int pin10 = 10;
int pin11 = 11;
int pin12 = 12;
int pin13 = 13;
int time = 50;
int totalLEDS = 182;
int n = 0;
int whichled = 0;
int last_n = 0;
int pickone = 0;


void setup(){
  pinMode(0, INPUT);
  pinMode(1, INPUT);
  pinMode(2, INPUT);
  pinMode(3, INPUT);
  pinMode(4, INPUT);
  pinMode(5, INPUT);
  pinMode(6, INPUT);
  pinMode(7, INPUT);
  pinMode(8, INPUT);
  pinMode(9, INPUT);
  pinMode(10, INPUT);
  pinMode(11, INPUT);
  pinMode(12, INPUT);

}



void light_cp_led(int whichone){

  static unsigned char last_n = 0;

  pinMode(cathodes[last_n], INPUT);  // turn off previous LED
  pinMode(anodes[last_n], INPUT);  // on both ends
  pinMode(cathodes[whichone], OUTPUT);  // turn on new LED cathode
  digitalWrite(cathodes[whichone], LOW);
  pinMode(anodes[whichone], OUTPUT);  // turn on new LED anode
  digitalWrite(anodes[whichone], HIGH);
  last_n = whichone;

}


void loop()
{
 static unsigned char whichled = 0;
 delay(time);  // Wait
 light_cp_led(whichled);
 whichled += 1;  // Pick next led
 if (whichled >= totalLEDS) { // Did we run out of LEDs?
   whichled = 0;  // If so, go back to first LED.
 }
}

This is definitely an improvement over yesterday though!!!!!!!

@westfw: Is setting the pinMode of the anode and cathode to INPUT sufficient to turn off the LED? Aren't these voltages "floating" at this point? If so, that would explain why some of Interesting's LEDs are not turning off and others are "dimly lit".

If so, I might try inserting a couple of lines into light_cp_led:

pinMode(cathodes[last_n], INPUT);  // turn off previous LED
pinMode(anodes[last_n], INPUT);  // on both ends
digitalWrite(anodes[last_n], HIGH); // use internal pullup to drive high
digitalWrite(cathodes[last_n], HIGH); // use internal pullup to drive high

Correct me if I'm crazy, please.

Interesting-- is it possible that some of your LEDs have been damaged, say, by current flowing the wrong way?

Mikal

It is definitely possible that some of the LEDs are dead, but just going through and putting one of the lines on the 3.3v and the other on the ground, a lot of single LEDS light up that aren't lighting up when the code is running.

The modifications you suggested made the lights flash a little more erratically, and it seemed to overload a little quicker than before.

I don't have the LEDs mapped very well so it's hard to see which leds are being powered from what cathode/anode, but from what I saw I think it might have just been going off a single cathode (it set pin 0 to high, and was cycling through 1,2,3,4,5,7,8,9,10,11,12,13 as the anode). At least that's what it seemed like..... [/s
Unplugging pin 1 doesn't stop the LEDs from lighting, but they definitely don't light as often over the time span, and when it stalls at the end, it is associated with pin 1.
What is the fastest refresh rate the arduino will accept? (it started going nuts when I did it at .01 milliseconds).

My theory about the "floating voltages" is fairly half-baked. Since that doesn't solve the problem, I think I'd remove my suggested code until someone with better HW savvy comments.

What do you mean by setting the "refresh rate" to 0.01 ms? The call to delay(time) can only go as low as 1ms (or 0). Delay() doesn't accept floating point values.-

For debugging I think I would have the sketch try to light just a single LED. Then a different one (with a new sketch!). Then still a different one until you are convinced that it can light each LED individually. Then slowly start turning two on in sequence and build up from there.

Mikal

Ah, no wonder it went bonkers!

Looks like it's gonna be a long night, time to get the coffee brewin!!

long night...

Possibly so, but perhaps fruitful! :slight_smile: You know, here's what I'd do:

  1. Comment all the entire body of loop() and add the following line to the bottom of setup():
light_cp_led(0);
  1. Upload and test
  2. If that works (illuminates only LED 0), change the line to
light_cp_led(1);
  1. If that works, try a handful of random LED numbers, like 28, 121, etc.
  2. When you're pretty sure any given single LED works, try two. Still in setup, try
light_cp_led(0);
delay(1000); // wait a sec
light_cp_led(1);
  1. Does LED 0 turn off correctly when LED 1 comes on? If not, try adding my little snippet back into the body of light_cp_led and try again.
  2. As long as it keeps working, keep trying more and more LEDs. Eventually, you'll come to a point where it doesn't work as expected but you have half a chance of identifying the problem because you have isolated it to a very specific case. Eventually it will all work!

Mikal

Oho! A couple minor comments and then a big one! :slight_smile:

Minor points:

  1. I assume your arrays are actually named cathode and anode and not cathode and cathode? :slight_smile:
  2. There is no point in declaring variables pin0..pin13 if you are not using them. Go ahead and remove them.
  3. For completeness, it would be nice to add pinMode(13, INPUT) to setup

Big point: If you declare an array PROGMEM, you can't access the members directly. The compiler will not complain, but you will get garbage. You have to use accessor functions. (See PROGMEM - Arduino Reference). Since your arrays are moderately small, I'd recommend just removing the PROGMEM keyword at least for now. This should change things considerably.

Mikal

Yeah, cathode and anode (i tried to switch them to see what it would change),

so you don't need the pin12 = 12 because you're just using n values, and you're setting the pins with that n value?

Added.

Removed progmem, stopped the halting problem, but it still doesn't light all of them up (I think it may possibly be an LED issue now :frowning: :frowning: :frowning: :frowning: :frowning: :frowning: :frowning: :frowning: :frowning: :frowning: :frowning: :()

I think you either need to remove PROGMEM statements from the array declarations, or add code to the function to deal with the fact that the arrays are in program memory (pgm_read_byte(), as described here: PROGMEM - Arduino Reference) You COULD be seeing random patterns essentially because you're apply random data to the anodes and cathodes...)

Okay fellas! Removing PROGMEM made a HELL of a lot more lights light up, not all of them, but a LOT.

Good enough for me a lot!

Now I need to devise a way to let me change the refresh rate without changing the sketch, I am thinking a rotary switch hooked up to the analog pins (which I can change to digital correct?), and then when it grounds pin 1, it will be this rate, pin 2 is this rate and so on. Shouldn't be too hard and I may just know how to program it myself!!!!

And I was hoping to have a couple more additions in the future.
Such as: Sound responsivity(?). I tried to hook a microphone once, but I couldn't figure out what values were changing. It should be a change in voltage or in current for a microphone????

And then I wanna make an ECG so the flashes go with my heart beat, that would be kind of cool as well and it would be variable!

This stuff is damn fun when it works!

Edit: It seems like it's still only lighting up half the LEDs, if I switch the wires for 0 and 1, different LEDs light up which makes me think that there's still a little something wrong with the programming...

Thoughts anyone?

Okay fellas, I have a completed project!

Sorry about the shit video quality, my phone doesn't take good video with marginal light.

I might take a better one, but as the light gets better the LEDS become less prominent.