Flex Sensor and Mini 8X8 LED Matrix????

I don't have a flexsensor, but I have a pot.
I didn't want to rig up a bunch of LEDs (it's your project), but I have a bulb that pulls 120mA (considerable draw), used a MOSFET. So, I rigged that much up and used the following sketch; pretty short and sweet --

/*
   read pot (sensor)
   result PWM
   repeat
*/
const byte sensorPin = 3;
const byte lightPin = 0;
int sensorval;

void setup() 
{
  pinMode (lightPin, OUTPUT);
}

void loop ()
{
  sensorRead();
  analogWrite (lightPin,sensorval);
}

void sensorRead ()
{
  delay(10);
  sensorval = analogRead(sensorPin);
  sensorval = sensorval/4;  //  1024/4 = 256
  if (sensorval < 20)       // for solid OFF "zone"
  {
    sensorval = 0;
  }  
}

I used an ATtiny85 instead of a full-blown Arduino, but, again, same difference.
For the analogWrite pins, use one of the designated PWM pins (D13 is not one.)
For the analogRead, use A0-A5.

> > > I guess I wasn't paying close enough attention - you've bought a matrix already.
I don't have any good suggestions for that (other than not using it.) You'll have to home-run 16 wires or something (not good)? I'm not a 7219 maven. Code intensive little things for being so "handy".
So, I guess your dilemma is: How To Vary the Intensity of LEDs with a 7219?

Also, with a 5x7, say, being a rectangle, basically everyone wants to reckon that as 5 columns and 7 rows.
But a square has as many rows as columns, so whether it's column cathodes or column rows is more, to me, in the eye of the beholder. Page 3 of your linked PDF shows how they figure though. I guess, looking at the labelled side with the pins pointing down, pin 1 is on the left (and pin 16 is directly opposite it on the other side.)

Here's the connections you want.
This code was written for IDE 00223 and is kinda long, but it gets the job done.
Need to declare all the variables with addresses per the MAX7219 datasheet, Table 2.
May have to change "SS" to "SSpin" or similar.

// ***********************************************************************************************
void setup() // stuff that runs once before looping forever
{
  // start up SPI to talk to the MAX7221
  SPI.begin(); // nothing in () because we are the master
  pinMode(SS, OUTPUT);  // Slave Select for SPI  <--- Need this here before any SPI writes

  //  MAX7221 
  // write shutdown register  
  digitalWrite(SS,LOW);  // take the SS pin low to select the chip:
  SPI.transfer(SHUTDOWN_ADDRESS);  // select the Address,
  SPI.transfer(0x00);      // select the data, 0x00 = Outputs turned off
  digitalWrite(SS,HIGH);   // take the SS pin high to de-select the chip:
  // Serial.println("shutdown register, dislays off");

  //  write intensity register
  digitalWrite(SS,LOW);  // take the SS pin low to select the chip:
  SPI.transfer(INTENSITY_ADDRESS);  // select the Address,
  SPI.transfer(intensity);      // select the data
  digitalWrite(SS,HIGH);   // take the SS pin high to de-select the chip:
  //Serial.println("intensity register ");

  // write scanlimit register
  digitalWrite(SS,LOW);  // take the SS pin low to select the chip:
  SPI.transfer(SCANLIMIT_ADDRESS);  // select the Address,
  SPI.transfer(0xFF);      // select the data - FF = all 8 digits
  digitalWrite(SS,HIGH);   // take the SS pin high to de-select the chip:
  //Serial.println("scanlimit register ");

  // write decode register
  digitalWrite(SS,LOW);  // take the SS pin low to select the chip:
  SPI.transfer(DECODE_MODE);  // select the Address,
  SPI.transfer(0xFF);      // select the data - FF = all 8 digits
  digitalWrite(SS,HIGH);   // take the SS pin high to de-select the chip:
  //Serial.println("decode register ");

  //display test
  digitalWrite(SS,LOW);  // take the SS pin low to select the chip:
  SPI.transfer(DISPLAYTEST_ADDRESS);  // select the Address,
  SPI.transfer(0x01);      // select the data
  digitalWrite(SS,HIGH);   // take the SS pin high to de-select the chip:
  //Serial.println("digit display test on ");
  delay (100);

  digitalWrite(SS,LOW);  // take the SS pin low to select the chip:
  SPI.transfer(DISPLAYTEST_ADDRESS);  // select the Address,
  SPI.transfer(0x00);      // select the data
  digitalWrite(SS,HIGH);   // take the SS pin high to de-select the chip:
  //Serial.println("digit display test off ");
  delay (100);

  // write shutdown register for normal display operations
  digitalWrite(SS,LOW);  // take the SS pin low to select the chip:
  SPI.transfer(SHUTDOWN_ADDRESS);  // select the Address,
  SPI.transfer(0x01);      // select the data, 0x01 = Normal Ops
  digitalWrite(SS,HIGH);   // take the SS pin high to de-select the chip:
  //Serial.println("shutdown register, displays on ");

  digitalWrite(SS,LOW);  // take the SS pin low to select the chip:
  SPI.transfer(digit0_address);  // select the Address,
  SPI.transfer(0xFF);      // all segments on
  digitalWrite(SS,HIGH);   // take the SS pin high to de-select the chip
  
  digitalWrite(SS,LOW);  // take the SS pin low to select the chip:
  SPI.transfer(digit1_address);  // select the Address,
  SPI.transfer(0xFF);      // all segments on
  digitalWrite(SS,HIGH);   // take the SS pin high to de-select the chip

    digitalWrite(SS,LOW);  // take the SS pin low to select the chip:
  SPI.transfer(digit2_address);  // select the Address,
  SPI.transfer(0xFF);      // all segments on
  digitalWrite(SS,HIGH);   // take the SS pin high to de-select the chip

    digitalWrite(SS,LOW);  // take the SS pin low to select the chip:
  SPI.transfer(digit3_address);  // select the Address,
  SPI.transfer(0xFF);      // all segments on
  digitalWrite(SS,HIGH);   // take the SS pin high to de-select the chip

    digitalWrite(SS,LOW);  // take the SS pin low to select the chip:
  SPI.transfer(digit4_address);  // select the Address,
  SPI.transfer(0xFF);      // all segments on
  digitalWrite(SS,HIGH);   // take the SS pin high to de-select the chip

    digitalWrite(SS,LOW);  // take the SS pin low to select the chip:
  SPI.transfer(digit5_address);  // select the Address,
  SPI.transfer(0xFF);      // all segments on
  digitalWrite(SS,HIGH);   // take the SS pin high to de-select the chip

    digitalWrite(SS,LOW);  // take the SS pin low to select the chip:
  SPI.transfer(digit6_address);  // select the Address,
  SPI.transfer(0xFF);      // all segments on
  digitalWrite(SS,HIGH);   // take the SS pin high to de-select the chip

    digitalWrite(SS,LOW);  // take the SS pin low to select the chip:
  SPI.transfer(digit7_address);  // select the Address,
  SPI.transfer(0xFF);      // all segments on
  digitalWrite(SS,HIGH);   // take the SS pin high to de-select the chip
    
} // end of void setup(), ready to interact with users

void loop(){
  //  write intensity register - vary from 0x00 (dim) to 0x0F (bright)
  digitalWrite(SS,LOW);  // take the SS pin low to select the chip:
  SPI.transfer(INTENSITY_ADDRESS);  // select the Address,
  SPI.transfer(intensity);      // select the data
  digitalWrite(SS,HIGH);   // take the SS pin high to de-select the chip:
  //Serial.println("intensity register ");
}

CrossRoads:
Here's the connections you want.
This code was written for IDE 00223 and is kinda long, but it gets the job done.
Need to declare all the variables with addresses per the MAX7219 datasheet, Table 2.
May have to change "SS" to "SSpin" or similar.

Great thanks a million. Sorry for cross threading but felt could get more answers faster and would have deleted after anyways as I know no one likes a know nothing cluttering good forums, again apologies for my ignorance this is just a project where our teachers really have thrown us in the deep end and expect too much as design students given the time they give us. Alas I have the entire matrix and MAX wired except for 2 things:

  1. What do i do with pin 24 if the matrix is all I want to rig?
  2. As per my calculations-although I don't think I fully understand variables
    I need a 30K resistor to be safe http://www.adafruit.com/datasheets/BL-M07C881.PDF

Instead of the code writing the brightness of the matrix I believe I may try the "bar graph" way of lighting LEDs
to simulate dimming and brightening by just changing the number of LED rows that are lit.

This guy is doing without a MAX??
Does that mean I will get more power to matrix?

Will get resistor tomorrow and try it all out! Excited.

bandrake:
Sorry for cross threading but felt could get more answers faster ...

No, it just wastes time as some people reply to one thread and some to another. Then they realize there are two threads going. Then they complain to a moderator. Then the moderator has to track it all down, merge / delete / warn. See how much time that wastes?

... and would have deleted after anyways ...

Don't delete threads please. This place is supposed to help other people as well, not just you.

How to use this forum

Pin 24 - leave it disconnected
Resistor - yeah, 30K sounds like it could be in range per pages 10 & 11.
I don't know anything about your matrix. One resistor, easy to change it.

You can drive the matrix like that, but you'll smoke the arduino pins sooner or later.
You want bright? Look at high mcd individual LEDs instead.
Wire up 8, turn in 1,2,3,4,5,6,7,8 with increasing brightness.

20mA will be blinding bright! Wear your shades, use a PWM pin for dimming.

CrossRoads:
You want bright? Look at high mcd individual LEDs instead.
Wire up 8, turn in 1,2,3,4,5,6,7,8 with increasing brightness.
White ø 5mm Clear LED Extra Bright 20,000mcd - dipmicro electronics
20mA will be blinding bright! Wear your shades, use a PWM pin for dimming.

http://www.dipmicro.com/store/IRF9540
http://www.dipmicro.com/store/STP16NF06

So these^^ MOSFETs would be comparable to the ones Pancake was helping me with but from that other site?
About to do a combined order from dipmicro is there anything else I should grab from that site?

Will be getting the resistor from radioshack later today...

IRF9540? NO, it's P-channel
STP16NF06? It's N-channel; still not "truly" logic-level - it may be acceptable with the current ( ID ) of your project.

Get This -- MOSFET Transistor N-Channel 60V/32A FQP30N06L - dipmicro electronics

Many thanks Runaway!!

You guys are making me think this will actually get done!

35mOhm, nice.

Dip Micro still hasn't come yet ugh but anxious for to set up the bright LEDS when it does.

Setup the max7219 and matrix I have now but only 6 random LEDs come on.
Attached is an image of my matrix pins from its data sheet.
I still feel like I don't have the proper MAX and matrix pins lined up.
My matrix is the one on the left. I understand the MAX outputs but they are SEGA or w/e not just simple
1,2,3,4... 16

Another problem could be that I didn't jump the +/- on the breadboard enough.
(I only did one jump on the other opposite side of the bread board)
Would this cause my problem?

If still working on this matrix is a waste of any of your time we can just wait until
the super brights come in with the MOSFETS and rig that up. Not sure I still understand how that
is going to work but will do more reading/tests of what both of you have posted thus far.

Thank you so much for all you guys have given...

Attached is how I had it rigged up.
Obviously ripped out the matrix in frustration but just so you guys can confirm
that I did have the other things correct:

4 and 9 ground
18 R and 19 V+
.1uF cap
1uF cap
Jump at opp end

Here's the code I was running also:

/* code for max 7219 from maxim,
reduced and optimised for useing more then one 7219 in a row,


Code History:

The orginal code was written for the Wiring board by:

First modification by:

This version is by:


General notes:

-if you are only using one max7219, then use the function maxSingle to control
the little guy ---maxSingle(register (1-8), collum (0-255))

-if you are using more then one max7219, and they all should work the same,
then use the function maxAll ---maxAll(register (1-8), collum (0-255))

-if you are using more than one max7219 and just want to change something
at one little guy, then use the function maxOne
---maxOne(Max you wane controll (1== the first one), register (1-8),
collum (0-255))

/* During initiation, be sure to send every part to every max7219 and then
upload it.
For example, if you have five max7219's, you have to send the scanLimit 5 times
before you load it-- other wise not every max7219 will get the data. the
function maxInUse keeps track of this, just tell it how many max7219 you are
using.
*/

int dataIn = 2;
int load = 3;
int clock = 4;

int maxInUse = 1; //change this variable to set how many MAX7219's you'll use

int e = 0; // just a varialble

// define max7219 registers
byte max7219_reg_noop = 0x00;
byte max7219_reg_digit0 = 0x01;
byte max7219_reg_digit1 = 0x02;
byte max7219_reg_digit2 = 0x03;
byte max7219_reg_digit3 = 0x04;
byte max7219_reg_digit4 = 0x05;
byte max7219_reg_digit5 = 0x06;
byte max7219_reg_digit6 = 0x07;
byte max7219_reg_digit7 = 0x08;
byte max7219_reg_decodeMode = 0x09;
byte max7219_reg_intensity = 0x0a;
byte max7219_reg_scanLimit = 0x0b;
byte max7219_reg_shutdown = 0x0c;
byte max7219_reg_displayTest = 0x0f;

void putByte(byte data) {
byte i = 8;
byte mask;
while(i > 0) {
mask = 0x01 << (i - 1); // get bitmask
digitalWrite( clock, LOW); // tick
if (data & mask){ // choose bit
digitalWrite(dataIn, HIGH);// send 1
}else{
digitalWrite(dataIn, LOW); // send 0
}
digitalWrite(clock, HIGH); // tock
--i; // move to lesser bit
}
}

void maxSingle( byte reg, byte col) {
//maxSingle is the "easy" function to use for a //single max7219

digitalWrite(load, LOW); // begin
putByte(reg); // specify register
putByte(col);//((data & 0x01) * 256) + data >> 1); // put data

digitalWrite(load,HIGH);
}

void maxAll (byte reg, byte col) { // initialize all MAX7219's in the system
int c = 0;
digitalWrite(load, LOW); // begin
for ( c =1; c<= maxInUse; c++) {
putByte(reg); // specify register
putByte(col);//((data & 0x01) * 256) + data >> 1); // put data
}

digitalWrite(load,HIGH);
}

void maxOne(byte maxNr, byte reg, byte col) {
//maxOne is for adressing different MAX7219's,
//whilele having a couple of them cascaded

int c = 0;
digitalWrite(load, LOW); // begin

for ( c = maxInUse; c > maxNr; c--) {
putByte(0); // means no operation
putByte(0); // means no operation
}

putByte(reg); // specify register
putByte(col);//((data & 0x01) * 256) + data >> 1); // put data

for ( c =maxNr-1; c >= 1; c--) {
putByte(0); // means no operation
putByte(0); // means no operation
}

digitalWrite(load,HIGH);
}

void setup () {

pinMode(dataIn, OUTPUT);
pinMode(clock, OUTPUT);
pinMode(load, OUTPUT);

digitalWrite(clock, HIGH);

//initiation of the max 7219
maxAll(max7219_reg_scanLimit, 0x07);
maxAll(max7219_reg_decodeMode, 0x00); // using an led matrix (not digits)
maxAll(max7219_reg_shutdown, 0x01); // not in shutdown mode
maxAll(max7219_reg_displayTest, 0x00); // no display test
for (e=1; e<=8; e++) { // empty registers, turn all LEDs off
maxAll(e,0);
}
maxAll(max7219_reg_intensity, 0x0f & 0x0f); // the first 0x0f is the value you can set
// range: 0x00 to 0x0f
}

void loop () {

//if you use just one MAX7219 it should look like this
/*
maxSingle(1,1); // + - - - - - - -
maxSingle(2,2); // - + - - - - - -
maxSingle(3,4); // - - + - - - - -
maxSingle(4,8); // - - - + - - - -
maxSingle(5,16); // - - - - + - - -
maxSingle(6,32); // - - - - - + - -
maxSingle(7,64); // - - - - - - + -
maxSingle(8,128); // - - - - - - - +

*/
//if you use more than one MAX7219, it should look like this

/*
maxAll(1,1); // + - - - - - - -
maxAll(2,3); // + + - - - - - -
maxAll(3,7); // + + + - - - - -
maxAll(4,15); // + + + + - - - -
maxAll(5,31); // + + + + + - - -
maxAll(6,63); // + + + + + + - -
maxAll(7,127); // + + + + + + + -
maxAll(8,255); // + + + + + + + +
*/

//

//if you use more then one max7219 the second one should look like this

maxSingle(1,1); // + - - - - - - -
maxSingle(2,2); // - + - - - - - -
maxSingle(3,4); // - - + - - - - -
maxSingle(4,8); // - - - + - - - -
maxSingle(5,16); // - - - - + - - -
maxSingle(6,32); // - - - - - + - -
maxSingle(7,64); // - - - - - - + -
maxSingle(8,128); // - - - - - - - +

//
delay(2000);

}

The Row pins go to the DIGIT outputs,
The Anode pins go the SEGMENT outputs.
If its not working, then you're likely wired incorrectly.
Here's 4 of them driving 4 matrices.

CrossRoads:
The Row pins go to the DIGIT outputs,
The Anode pins go the SEGMENT outputs.
If its not working, then you're likely wired incorrectly.
Here's 4 of them driving 4 matrices.

Ok great I think I will be able to figure that then will wire post and post a picture ASAP

Only reason I didn't use your code Crossroads is because I couldn't figure out how to edit to verify.
I can only figure simple things like editing pin numbers lol sorry. No need to reload code but may be
necessary when get the LCDs going so I can have that one perfect. Thanks so much.

CrossRoads:
The Row pins go to the DIGIT outputs,
The Anode pins go the SEGMENT outputs.

Is DIG0-just row pin 1 for me?
then DIG1 is row pin 2... ??

Also SEG DP? Is that just the 8th of the segments so just go:
SEG A = column 1 pin?

Yes, or perhaps flip one set of pins end for end if your output looks mirrored (flip the columns) or inverted (flip the segments).

CrossRoads:
Here's the connections you want.
This code was written for IDE 00223 and is kinda long, but it gets the job done.
Need to declare all the variables with addresses per the MAX7219 datasheet, Table 2.
May have to change "SS" to "SSpin" or similar.

Crossroads! Attached is a pic of it wired up with your latest info SEG-column and DIG-row and 16 LEDS are lit!
This is with a 3.3k Resistor... Was thinking though that it may just be the other code I am running?

Maybe then telling me exactly how to revise the one you attached would be worth while? This is pretty bright with
just a 1/4 of the matrix lit! Awesome this is great thank you so much!

CrossRoads:
Yes, or perhaps flip one set of pins end for end if your output looks mirrored (flip the columns) or inverted (flip the segments).

I flipped rows first got same then flipped columns at same time and got same 16 lit up...

Check the wiring, post the code you have running.
I can see you are not connected to the SPI pins.

CrossRoads:
Check the wiring, post the code you have running.
I can see you are not connected to the SPI pins.

I am connected to 2,3,4 of the digital pins with respectively: Din (MAX1), Load (MAX12), CLK (MAX13)

/* code for max 7219 from maxim,
reduced and optimised for useing more then one 7219 in a row,
______________________________________
 
 Code History:
 --------------
 
The orginal code was written for the Wiring board by:
 * Nicholas Zambetti and Dave Mellis /Interaction Design Institute Ivrea /Dec 2004
 * http://www.potemkin.org/uploads/Wiring/MAX7219.txt
 
First modification by:
 * Marcus Hannerstig/  K3, malm? h?gskola /2006
 * http://www.xlab.se | http://arduino.berlios.de
 
This version is by:
 * tomek ness /FH-Potsdam / Feb 2007
 * http://design.fh-potsdam.de/
 
 * @acknowledgements: eric f.
 
-----------------------------------
 
General notes:
 
 
-if you are only using one max7219, then use the function maxSingle to control
 the little guy ---maxSingle(register (1-8), collum (0-255))
 
-if you are using more then one max7219, and they all should work the same,
then use the function maxAll ---maxAll(register (1-8), collum (0-255))
 
-if you are using more than one max7219 and just want to change something
at one little guy, then use the function maxOne
---maxOne(Max you wane controll (1== the first one), register (1-8),
collum (0-255))
 
/* During initiation, be sure to send every part to every max7219 and then
 upload it.
For example, if you have five max7219's, you have to send the scanLimit 5 times
before you load it-- other wise not every max7219 will get the data. the
function maxInUse  keeps track of this, just tell it how many max7219 you are
using.
*/
 
int dataIn = 2;
int load = 3;
int clock = 4;
 
int maxInUse = 1;    //change this variable to set how many MAX7219's you'll use
 
int e = 0;           // just a varialble
 
                     // define max7219 registers
byte max7219_reg_noop        = 0x00;
byte max7219_reg_digit0      = 0x01;
byte max7219_reg_digit1      = 0x02;
byte max7219_reg_digit2      = 0x03;
byte max7219_reg_digit3      = 0x04;
byte max7219_reg_digit4      = 0x05;
byte max7219_reg_digit5      = 0x06;
byte max7219_reg_digit6      = 0x07;
byte max7219_reg_digit7      = 0x08;
byte max7219_reg_decodeMode  = 0x09;
byte max7219_reg_intensity   = 0x0a;
byte max7219_reg_scanLimit   = 0x0b;
byte max7219_reg_shutdown    = 0x0c;
byte max7219_reg_displayTest = 0x0f;
 
void putByte(byte data) {
  byte i = 8;
  byte mask;
  while(i > 0) {
    mask = 0x01 << (i - 1);      // get bitmask
    digitalWrite( clock, LOW);   // tick
    if (data & mask){            // choose bit
      digitalWrite(dataIn, HIGH);// send 1
    }else{
      digitalWrite(dataIn, LOW); // send 0
    }
    digitalWrite(clock, HIGH);   // tock
    --i;                         // move to lesser bit
  }
}
 
void maxSingle( byte reg, byte col) {    
//maxSingle is the "easy"  function to use for a     //single max7219
 
  digitalWrite(load, LOW);       // begin    
  putByte(reg);                  // specify register
  putByte(col);//((data & 0x01) * 256) + data >> 1); // put data  
 
  digitalWrite(load,HIGH);
}
 
void maxAll (byte reg, byte col) {    // initialize  all  MAX7219's in the system
  int c = 0;
  digitalWrite(load, LOW);  // begin    
  for ( c =1; c<= maxInUse; c++) {
  putByte(reg);  // specify register
  putByte(col);//((data & 0x01) * 256) + data >> 1); // put data
    }
    
  digitalWrite(load,HIGH);
}
 
void maxOne(byte maxNr, byte reg, byte col) {    
//maxOne is for adressing different MAX7219's,
//whilele having a couple of them cascaded
 
  int c = 0;
  digitalWrite(load, LOW);  // begin    
 
  for ( c = maxInUse; c > maxNr; c--) {
    putByte(0);    // means no operation
    putByte(0);    // means no operation
  }
 
  putByte(reg);  // specify register
  putByte(col);//((data & 0x01) * 256) + data >> 1); // put data
 
  for ( c =maxNr-1; c >= 1; c--) {
    putByte(0);    // means no operation
    putByte(0);    // means no operation
  }
 
  digitalWrite(load,HIGH);
}
 
 
void setup () {
 
 
  pinMode(dataIn, OUTPUT);
  pinMode(clock,  OUTPUT);
  pinMode(load,   OUTPUT);
 

  digitalWrite(clock, HIGH);  
 
//initiation of the max 7219
  maxAll(max7219_reg_scanLimit, 0x07);      
  maxAll(max7219_reg_decodeMode, 0x00);  // using an led matrix (not digits)
  maxAll(max7219_reg_shutdown, 0x01);    // not in shutdown mode
  maxAll(max7219_reg_displayTest, 0x00); // no display test
   for (e=1; e<=8; e++) {    // empty registers, turn all LEDs off
    maxAll(e,0);
  }
  maxAll(max7219_reg_intensity, 0x0f & 0x0f);    // the first 0x0f is the value you can set
                                                  // range: 0x00 to 0x0f
}  
 
void loop () {
 
 
  //if you use just one MAX7219 it should look like this
  /*
   maxSingle(1,1);                       //  + - - - - - - -
   maxSingle(2,2);                       //  - + - - - - - -
   maxSingle(3,4);                       //  - - + - - - - -
   maxSingle(4,8);                       //  - - - + - - - -
   maxSingle(5,16);                      //  - - - - + - - -
   maxSingle(6,32);                      //  - - - - - + - -
   maxSingle(7,64);                      //  - - - - - - + -
   maxSingle(8,128);                     //  - - - - - - - +
 
  */
  //if you use more than one MAX7219, it should look like this
 
  /*
  maxAll(1,1);                       //  + - - - - - - -
  maxAll(2,3);                       //  + + - - - - - -
  maxAll(3,7);                       //  + + + - - - - -
  maxAll(4,15);                      //  + + + + - - - -
  maxAll(5,31);                      //  + + + + + - - -
  maxAll(6,63);                      //  + + + + + + - -
  maxAll(7,127);                     //  + + + + + + + -
  maxAll(8,255);                     //  + + + + + + + +
  */
 
  //
 
  //if you use more then one max7219 the second one should look like this
 
 
   maxSingle(1,1);                       //  + - - - - - - -
   maxSingle(2,2);                       //  - + - - - - - -
   maxSingle(3,4);                       //  - - + - - - - -
   maxSingle(4,8);                       //  - - - + - - - -
   maxSingle(5,16);                      //  - - - - + - - -
   maxSingle(6,32);                      //  - - - - - + - -
   maxSingle(7,64);                      //  - - - - - - + -
   maxSingle(8,128);                     //  - - - - - - - +
 
 
  //
  delay(2000);
 
}

CrossRoads:
You want bright? Look at high mcd individual LEDs instead.
Wire up 8, turn in 1,2,3,4,5,6,7,8 with increasing brightness.
White ø 5mm Clear LED Extra Bright 20,000mcd - dipmicro electronics
20mA will be blinding bright! Wear your shades, use a PWM pin for dimming.

Crossroads! These LEDs are sick bright. Since 5V that means I do not need resistors?
Below is the code I have running with the flex sensor. It just gradually turns on more LEDs
so the brightness is just controlled by the number of LEDs lit.

What is the max number of these LEDs I can run with the 9V wall plug?
-I understand the code and how to adjust number of LEDs and when they come on given the flex sensor
I just need to know max and if can only use certain pins... Can I run 12 of them?
Do I need resistors?

Lastly, would it work if the arduino and the LED breadboard were 20" of wire apart-low gauge as usual?
I would still have the flex and arduino within inches of each other but the LEDs would be in a different part.

int pin1 = 8;
int pin2 = 9;
int pin3 = 10;
int pin4 = 11;

void setup() {
   pinMode(pin1,OUTPUT);
   pinMode(pin2,OUTPUT);
   pinMode(pin3,OUTPUT);
   pinMode(pin4,OUTPUT);
   Serial.begin(9600);
}

void loop(){
  int sensorValue = analogRead(A0);
  Serial.println(sensorValue);
  if(sensorValue <= 400){
    digitalWrite(pin1,HIGH);
  } else {
    digitalWrite(pin1,LOW);
  }
  if(sensorValue <= 450){
    digitalWrite(pin2,HIGH);
  } else {
    digitalWrite(pin2,LOW);
  }
    if(sensorValue <= 450){
    digitalWrite(pin3,HIGH);
  } else {
    digitalWrite(pin3,LOW);
  }
  if(sensorValue <= 500){
    digitalWrite(pin4,HIGH);
  } else {
    digitalWrite(pin4,LOW);
  }
}