I have made a simple 6x6 LOL and it works fine. I decided to use a MMA7361 accelerometer to control the position of the lit up LED on the LOL. (Tilt away light moves up, tilt towards light moves down you get the idea). So it looks like it works fine but I have a problem with the first column of the LOL. When I tilt the whole thing to the left as the light reaches the first column it disappears, when you tilt it down where the light is supposed to reach the bottom of the LOL and then tilt right the light appears where you would expect it to be, at the bottom of the LOL. (All LEDs are working)
For some reason I decided to expand some of the loops in the program trying to solve it. Still doesn't work..

This is the code that I am using.
//X=470
//Y=360
//Z=350
int XPin = A2; // X
int YPin = A1; // Y
int ZPin = A0; // Z
int valX = 0;
int valY = 0;
int valZ = 0;
int vert=3;
int hoz=7;
void setup() {
Serial.begin(9600);
pinMode(0, OUTPUT);
pinMode(1, OUTPUT);
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);
pinMode(12, OUTPUT);
pinMode(13, OUTPUT);
for(int x=0; x<8; x++){
digitalWrite(x, LOW);
}
for(int x=7; x<14; x++){
digitalWrite(x, HIGH);
}
}
void loop() {
digitalWrite(0, HIGH);
valX = analogRead(XPin);
valY = analogRead(YPin);
valZ = analogRead(ZPin);
Serial.print(" X-");
Serial.print(valX);
Serial.print(" Y-");
Serial.print(valY);
Serial.print(" Z-");
Serial.print(valZ);
Serial.print("\n");
int updown=valY-350;
int sides=valX-350;
if (sides<-75 && vert!=1){
vert=vert-1;
}
if (sides>75 && vert<6){
vert=vert+1;
}
if (updown<-75 && hoz<12){
hoz=hoz+1;
}
if (updown>75 && hoz>7){
hoz=hoz-1;
}
digitalWrite(hoz, LOW);
digitalWrite(vert, HIGH);
digitalWrite(hoz, HIGH);
digitalWrite(vert, LOW);
}
If you would like to see the circuit drawing please just ask.
Thank you.