Charlieplexing,the software part.

Hi, i hooked up 6 leds according the the charlieplexing diagram. driving them from 3 pins. But i cannot seem to write a software to drive them. Let's say i want to light the first led:

int led1Pin = 9;
int led2Pin = 10;
int led3Pin = 11;

void setup() 
pinMode(led1Pin, OUTPUT);
pinMode(led2Pin, OUTPUT);
pinMode(led3Pin, OUTPUT);


  void loop(){

    digitalWrite(led3Pin, HIGH);


2 leds open, i would need a way so the current doesnt go thru the 1st pin, so pin3 is HIGH, the 2nd is LOW and the 1st would need to be... nothing...



Set it an input temporarily?

It's pretty easy if you only try to light one LED at a time:

// Turn off all LEDs by setting all pins to inputs
// Look up anode (LED#) and cathode(LED#)  These return pins for the + and - side, respectively
  anode = anodeTable[lednum];
  cathode = cathodeTable[lednum];
// set pin values appropriately.
  digitlaWrite(anode, 1);
  digitalWrite(cathode, 0);
// set pins to outputs so that the digitalWrites take effect.
  pinMode(anode, OUTPUT);
  pinMode(cathode, OUTPUT);

(this was last done on a tiny11 in assembly; See My instructable for the schematic and downloadable code (although that was row/column based) I'm not sure it will work exactly in the arduino environment (for instance, can you DO digitalWrite()? before pinMode()?) But the basic ideas should hold. And the 1Mhz tiny11 was plenty fast to do a flicker-free display of 20 LEDs, so an arduino should be able to do even more. I never did write the code to do a whole row at a time; though that would have made possible a brighter display.