Simple flash

Hello All

i want to have LED 1 flash for one second turn off for one second then LED 2 come on for a second and turn off for a second.....and loop, eventually leading to a poor mans multiplexing. I cant seem to get working, what happens is they both come on for one second and off for two.

please advise.....thanks

void setup() {                
  // initialize the digital pin as an output.
  pinMode(13, OUTPUT);
  pinMode(12, OUTPUT);  
}

void loop() {
  digitalWrite(13, HIGH);   // set the LED1 on
  delay(1000);              // wait for a second
  digitalWrite(13, LOW);    // set the LED1 off
  delay(1000);              // wait for a second
  digitalWrite(12, HIGH);   // set the LED2 on
  delay(1000);              // wait for a second
  digitalWrite(12, LOW);    // set the LED2 off
  delay(1000);              // wait for a second
}

Do you want LED2 to come on right after LED1 goes off?

void loop() {
  digitalWrite(13, HIGH);   // set the LED1 on
 digitalWrite(12, LOW);    // set the LED2 off
  delay(1000);              // wait for a second
  digitalWrite(13, LOW);    // set the LED1 off
 digitalWrite(12, HIGH);   // set the LED2 on
  delay(1000);              // wait for a second

}

the end result will be using this code to multiplex a 8x8 RGB, i had it hooked up to said matrix and the effect was described above, however I disconnected the circuit and hooked up only two LEDs and the code worked!!!

any thoughts?

It all depends on if the matrix was hooked up correctly. Do you have a schematic of your setup?

http://www.robotshop.com/ca/content/PDF/2088rgbmatrix-led204a5b.pdf

do you have a schematic of how and what was hooked to your board?