5x16 LED Marquee Phantom LEDs Turning On

I have built a 5x16 LED Array to make a marquee sign. I am replicating NerdKits - DIY Marquee LED Array Display but not with as many LEDs (unfortunately ;D).

There are 5 “row wires” and 8 “column wires”. Each column consists of 2 LED columns. Putting HIGH through a column and LOW through a row turns on the left side of each coulmn. Reversing HIGH and LOW lights up the right side of the column.

I found a wonderful charlieplexing class on the wiki and have made it work for my setup. (http://www.arduino.cc/playground/Code/Charlieplex)

Here is where my problem lies. When using this class and cycling through all 80 LEDs, there are some on pin 0 that come on and flash seeming randomly. Also, other random pins are very faintly glowing. I know for a fact it isnt a wiring/electrical issue because if I cycle through the hard way, it doesnt do it. Something in the code is causing them to flash.

Here is my code:

#include <Charlieplex.h>

#define NUMBER_OF_PINS 13

byte pins[] = {0,1,2,3,4,5,6,7,8,9,10,11,12};
Charlieplex charlieplex = Charlieplex(pins,NUMBER_OF_PINS);

charliePin leds[80] = { {0,12}, {12,0}, {1,12}, {12,1}, {2,12}, {12,2},
                        {3,12}, {12,3}, {4,12}, {12,4}, {5,12}, {12,5},
                        {6,12}, {12,6}, {7,12}, {12,7}, {0,11}, {11,0}, 
                        {1,11}, {11,1}, {2,11}, {11,2}, {3,11}, {11,3},  
                        {4,11}, {11,4}, {5,11}, {11,5}, {6,11}, {11,6}, 
                        {7,11}, {11,7}, {0,10}, {10,0}, {1,10}, {10,1}, 
                        {2,10}, {10,2}, {3,10}, {10,3}, {4,10}, {10,4}, 
                        {5,10}, {10,5}, {6,10}, {10,6}, {7,10}, {10,7},
                        {0,9}, {9,0}, {1,9}, {9,1}, {2,9}, {9,2}, 
                        {3,9}, {9,3}, {4,9}, {9,4}, {5,9}, {9,5}, 
                        {6,9}, {9,6}, {7,9}, {9,7}, {0,8}, {8,0}, 
                        {1,8}, {8,1}, {2,8}, {8,2}, {3,8}, {8,3}, 
                        {4,8}, {8,4}, {5,8}, {8,5}, {6,8}, {8,6}, 
                        {7,8}, {8,7} };

boolean singleOn = false;

void setup() { /* nothing */ }

void loop(){
  
  if (singleOn) charlieplex.clear();
  
  //Cycle through all 80 starting at the top left going to the right
  for (int i=0;i<80;i++) {
    charlieplex.charlieWrite(leds[i],HIGH);
    delay(15);
    pinMode(leds[i].vcc, INPUT);    //2 inputs is less calculating time than clearing 13 pins
    pinMode(leds[i].gnd, INPUT);
  }
  singleOn=!singleOn;
}

Hello.

Could you identify exactly which index /led causes the flashing. ?

I am the author of that library, unfortunantly I have not tested it above 3 lines. :-[

I’ll gladly help fixing the error/bug.

[edit]

It is generally better to use other pins than 0 and 1. They are serial rx tx.

What does this do?
[UNTESTED CODE]

#include <Charlieplex.h>

#define NUMBER_OF_PINS 13

//byte pins = {2,3,4,5,6,7,8,9,10,11,12,13,14};
byte pins = {0,1,2,3,4,5,6,7,8,9,10,11,12};
Charlieplex charlieplex = Charlieplex(pins,NUMBER_OF_PINS);

charliePin leds[80] = {
{0,12}, {12,0}, {1,12}, {12,1},
{2,12}, {12,2}, {3,12}, {12,3},
{4,12}, {12,4}, {5,12}, {12,5},
{6,12}, {12,6}, {7,12}, {12,7},
{0,11}, {11,0}, {1,11}, {11,1},
{2,11}, {11,2}, {3,11}, {11,3},
{4,11}, {11,4}, {5,11}, {11,5},
{6,11}, {11,6}, {7,11}, {11,7},
{0,10}, {10,0}, {1,10}, {10,1},
{2,10}, {10,2}, {3,10}, {10,3},
{4,10}, {10,4}, {5,10}, {10,5},
{6,10}, {10,6}, {7,10}, {10,7},
{0,9}, {9,0}, {1,9}, {9,1},
{2,9}, {9,2}, {3,9}, {9,3},
{4,9}, {9,4}, {5,9}, {9,5},
{6,9}, {9,6}, {7,9}, {9,7},
{0,8}, {8,0}, {1,8}, {8,1},
{2,8}, {8,2}, {3,8}, {8,3},
{4,8}, {8,4}, {5,8}, {8,5},
{6,8}, {8,6}, {7,8}, {8,7}
};

void setup() { /* nothing */ }

void loop(){
charlieplex.clear();

//Cycle through all 80 starting at the top left going to the right
for (int i=0;i<80;i++) {
charlieplex.charlieWrite(leds*,HIGH);*

  • delay(15);*
    _ pinMode(leds*.vcc, INPUT); //2 inputs is less calculating time than clearing 13 pins*_
    _ pinMode(leds*.gnd, INPUT);
    }
    }
    [/quote][/edit]*_

It appears that the left most column (pin 0 with column high and row low) are fully lit up when the right side of a column is lit (when column low, row high).

Also, when the right side of a column is lit up, all the LEDs in the column are dimly lit, but the one that is supposed to be on is fully lit.

There are a few others that appear to be slightly glowing at random.