Please help can't find software error

Hello I am building a simple output display and I am running into trouble on the code side of things. I have four inputs which accept values of high or low. one works (oil Pressure) but the other three do not register a reading. can anyone see what I am doing wrong? Here is the code

/* oil pressure Input=0 Output=8 Neutral Input=1 Output=9 High beam Input=2 Output=10 Right Turn Input=3 Output=11 Left Turn Input=4 Output=11 */

boolean oil = 0; boolean hBeam = 0; boolean neu = 0; boolean turnR = 0; boolean turnL = 0;

void setup() { delay(2000); Serial.begin(9600); pinMode(0,INPUT); pinMode(1,INPUT); pinMode(2,INPUT); pinMode(3,INPUT); pinMode(4,INPUT); pinMode(5,INPUT); pinMode(6,INPUT); pinMode(7,INPUT); pinMode(8,OUTPUT); pinMode(9,OUTPUT); pinMode(10,OUTPUT); pinMode(11,OUTPUT); pinMode(12,OUTPUT); pinMode(13,OUTPUT); }

void loop() { oil = digitalRead(0); hBeam = digitalRead(1); neu = digitalRead(2); turnR = digitalRead(3); turnL = digitalRead(4); /Oil Pressure/ if (oil == HIGH) { Serial.println("Oil Pressure Warning!");

delay(2000); } else { Serial.println("Oil Pressure Normal."); delay(2000); } /Neutral/ if (neu == HIGH) { Serial.println("Transmission in Neutral");

delay(2000); } else { Serial.println("Transmission In Gear."); delay(2000); } /High Beam/ if (hBeam == HIGH) { Serial.println("High Beam On");

delay(2000); } else { Serial.println("High Beam Off."); delay(2000); } /Turn Signals/ if (turnR == HIGH || turnL == HIGH) { Serial.println("Turn Signal Active.");

delay(2500); } else { Serial.println("Turn Signals Off."); delay(2500); } }

I would get rid of all those delays and just have one at the end of loop. You are cumulatively delaying after each display.

Also, how are they wired?

http://gammon.com.au/switches

You appear to be using pins 0 and 1 for digital I/O and serial I/O.

[quote author=Nick Gammon link=topic=189171.msg1399493#msg1399493 date=1379742082] I would get rid of all those delays and just have one at the end of loop. You are cumulatively delaying after each display.

Also, how are they wired?

http://gammon.com.au/switches [/quote]

This is my wiring setup,the finished project will have four of these total, but right now I just use one for testing purposes and connect the "to input pin" wire to the different pins to test the results.

AWOL: You appear to be using pins 0 and 1 for digital I/O and serial I/O.

Even after changing the pins i still have the same problem

And we have the problem that we can't see your code or your debug output.

AWOL: And we have the problem that we can't see your code or your debug output.

I reverted back to a simple program to eliminate as many factors as possible, I'll try rebuilding the circuit on a different bread board

boolean val = 0;

void setup() { Serial.begin(9600); pinMode(2,INPUT); }

void loop() { val = digitalRead(2); if (val == HIGH) { Serial.println("opto HI!"); delay(250); } else { Serial.println("opto LO!"); delay(250); } }

Ashdricky: This is my wiring setup,the finished project will have four of these total, but right now I just use one for testing purposes and connect the "to input pin" wire to the different pins to test the results.

My crystal ball isn't working today, so I'm unable to tell what the unlabelled 6 pin component is, but you could try replacing 'these' with 25A 100V double-acting 6pin thingamybob.

Ashdricky: I reverted back to a simple program to eliminate as many factors as possible, I'll try rebuilding the circuit on a different bread board

And your debug output?

Code tags please.

Read this before posting a programming question

[quote author=Nick Gammon link=topic=189171.msg1400310#msg1400310 date=1379800210]

Ashdricky: I reverted back to a simple program to eliminate as many factors as possible, I'll try rebuilding the circuit on a different bread board

And your debug output?

Code tags please.

Read this before posting a programming question

[/quote]

so It turned out that I must have damaged two of the optocouplers as once I replace the two in the circuits that were not functioning all worked well.