Help with code

is there anything wrong with this code? The arduino code editior says it is ok, but it doesnt work.

int d1a=13;

int d2a= 12;

int s1= 10;

int d1b=11;

int d2b=8;

int sb=9;

int sensorPin = 5;

void setup () {

Serial.begin(9600);

pinMode (d1a, OUTPUT);

pinMode (d2a, OUTPUT);

pinMode (s1, OUTPUT);

pinMode (d1b, OUTPUT);

pinMode (d2b, OUTPUT);

pinMode (sb, OUTPUT);

}

void loop () {

int val= analogRead (sensorPin);

Serial.println (val);

if (val > 520) {

analogWrite (10, 0);

digitalWrite (13 , LOW);

digitalWrite (12, HIGH);

analogWrite (9, 255);

digitalWrite (11 , LOW);

digitalWrite (8, HIGH);

}

else {

analogWrite (10, 255);

digitalWrite (13 ,LOW);

digitalWrite (12, HIGH);

analogWrite (9, 255);

digitalWrite (11 , LOW);

digitalWrite (8, HIGH);

}

}

Well, people are going to (correctly) state that we don’t know what it is SUPPOSED to do, nor do we know what it ACTUALLY does, so how can we know what’s wrong?

very good question…i think i fixed it myself FOr now

Obscurity Index overload.

There’s something wrong with my car. It seems to be making a strange noise and doesn’t work right. Could some one fix it please.

I can fix it. I’ll paint it blue. That should cure the noise and the whiteness.

And I’ll swap the visors and see if that makes it work right.

where’s the comments and explanations of what this is supposed to do?

Not wise to omit comments… for your own sake 3 months from now.