Is the Arduino unreliable or am I doing it wrong?

I've spent a long frustrating time with my Duemilanove.

I want to plug up 5 switches and an LCD screen.

When I first got it I plugged up the LCD no problem thanks to a clear guide. I tried to add switches, then just trying one switch, then I disconnected the LCD and messed around with the switches. Somehow, I eventually got the 5 switches to work with this code:

#define AD 2
#define AU 3
#define BD 4
#define BU 5
#define CR 6

int ADV, AUV, BDV, BUV, CRV;

int ADOV, AUOV, BDOV, BUOV, CROV;

int ADS, AUS, BDS, BUS, CRS;

void setup() {
  Serial.begin(9600);
  pinMode(AD, INPUT);
  pinMode(AU, INPUT);
  pinMode(BD, INPUT);
  pinMode(BU, INPUT);
  pinMode(CR, INPUT);
  digitalWrite(AD, HIGH);
  digitalWrite(AU, HIGH);
  digitalWrite(BD, HIGH);
  digitalWrite(BU, HIGH);
  digitalWrite(CR, HIGH);
}
void loop(){
  ADV = digitalRead(AD);
  AUV = digitalRead(AU);
  BDV = digitalRead(BD);
  BUV = digitalRead(BU);
  CRV = digitalRead(CR);
  
  if (ADV != ADOV){
    if (ADV == LOW){
      Serial.print("AD");
      delay(10);
    }
  }
  if (AUV != AUOV){
    if (AUV == LOW){
      Serial.print("AU");
      delay(10);
    }
  } else if (BDV != BDOV){
    if (BDV == LOW){
      Serial.print("BD");
      delay(10);
    }
  } else if (BUV != BUOV){
    if (BUV == LOW){
      Serial.print("BU");
      delay(10);
    }
  } else if (CRV != CROV){
    if (CRV == LOW){
      Serial.print("CR");
      delay(10);
    }
  }
  ADOV = ADV;
  AUOV = AUV;
  BDOV = BDV;
  BUOV = BUV;
  CROV = CRV;
}

"Great" I thought. Then I plugged the LCD back in and nothing worked. "Balls" I thought. So I unplugged it and went back to the 5 switches setup and reuploading the above script, except now it doesn't work.

The wires are in the same places, they weren't disconnected. Can anyone think of a reason why it wouldn't work anymore?

The arduino is not unreliable, you are doing something wrong. However from what you posted I can't see what it is. What pins are you using for the LCD, are the grounds all connected together?

This is what I had for using the LCD:

#include <LiquidCrystal.h>
#define AD 2
#define AU 3
#define BD 4
#define BU 5
#define CR 6

LiquidCrystal lcd(7, 8, 9, 10, 11, 12);

int ADV, AUV, BDV, BUV, CRV;

int ADOV, AUOV, BDOV, BUOV, CROV;

int ADS, AUS, BDS, BUS, CRS;

void setup() {
  Serial.begin(9600);
  pinMode(AD, INPUT);
  pinMode(AU, INPUT);
  pinMode(BD, INPUT);
  pinMode(BU, INPUT);
  pinMode(CR, INPUT);
  digitalWrite(AD, HIGH);
  digitalWrite(AU, HIGH);
  digitalWrite(BD, HIGH);
  digitalWrite(BU, HIGH);
  digitalWrite(CR, HIGH)
  lcd.begin(20, 4);
  lcd.print("Hello World");
}
void loop(){
  ADV = digitalRead(AD);
  AUV = digitalRead(AU);
  BDV = digitalRead(BD);
  BUV = digitalRead(BU);
  CRV = digitalRead(CR);
  
  if (ADV != ADOV){
    if (ADV == LOW){
      Serial.print("AD");
      delay(10);
    }
  }
  if (AUV != AUOV){
    if (AUV == LOW){
      Serial.print("AU");
      delay(10);
    }
  } else if (BDV != BDOV){
    if (BDV == LOW){
      Serial.print("BD");
      delay(10);
    }
  } else if (BUV != BUOV){
    if (BUV == LOW){
      Serial.print("BU");
      delay(10);
    }
  } else if (CRV != CROV){
    if (CRV == LOW){
      Serial.print("CR");
      delay(10);
    }
  }
  ADOV = ADV;
  AUOV = AUV;
  BDOV = BDV;
  BUOV = BUV;
  CROV = CRV;
}

I’ve probably missed something but my main concern was when removed the LCD I couldn’t revert back to the 5 switches.

On the switches I don’t have a ground but I haven’t removed any wires since it was working. I was trying to use resistors but then I got it working with the internal restistance. Now the setup is 5V {switch} Digital input, pressing it connects the two (since I removed the resistor there was no connection to the ground).

Those two sketches use the same pins so you can't have them going at the same time.

On the switches I don't have a ground

Switches should be wired between input pin and ground with the internall up up enabled (this you did).

If you're trying to print to the lcd why are you using Serial.print in the loop section? Does it at least print the "Hello World" on the lcd from the setup section where you used lcd.print?

Thank you Grumpy_Mike. I connected it to the ground and now both the switches and LCD work. I am sorry for ever doubting the Arduino.

wayneft, I am using the Serial.print to send information to the computer that I will use a Python script to use. I haven't even started on this because I was still trying to get to grips with the hardware. Any suggestion of a better starting point than sending the "AD,AU" type messages would greatly appreciated.