RFID reader buggering input **SOLVED**

UPDATE: All your fantTAStic help :wink: has led to some success. All done here!

Hullo, I’m very new to Arduino, so I apologize if this is a trivial mistake.

Based on the example code provided in the playground, I have this:

#include <SoftwareSerial.h>

int  val = 0; 
char code[10]; 
int bytesread = 0; 
char card1[10] = {
  'A', '3', '3', '3', '3', '3', '3', '3', '3', '3'};
char card2[10] = {
  '3', '6', '0', '0', 'A', '8', 'E', '9', 'B', 'A'};
char card3[10] = {
  '3', '6', '0', '0', '8', '5', '3', 'A', 'B', '1'};

#define doorPin 5
#define rxPin 8
#define txPin 9
#define piezoPin 13
#define switchPower 4
#define switchPin 0
// RFID reader SOUT pin connected to Serial RX pin at 2400bps to pin8

void setup()
{ 
  Serial.begin(9600);  // Hardware serial for Monitor 9600bps
  pinMode(2,OUTPUT);       // Set digital pin 2 as OUTPUT to connect it to the RFID /ENABLE pin 
  digitalWrite(2, LOW);    // Activate the RFID reader 
  pinMode(doorPin, OUTPUT);
  digitalWrite(doorPin, LOW);
  //pinMode(switchPin, OUTPUT);
  pinMode(piezoPin, OUTPUT);
  pinMode(switchPower, OUTPUT);
  digitalWrite(switchPower, HIGH);
}


void loop()
{ 
  SoftwareSerial RFID = SoftwareSerial(rxPin,txPin); 
  RFID.begin(2400);
  int button = 0;
  if((val = RFID.read()) == 10)
  {   // check for header 
    bytesread = 0; 
    while(bytesread<10)
    {  // read 10 digit code 
      val = RFID.read(); 
      if((val == 10)||(val == 13))
      {  // if header or stop bytes before the 10 digit reading 
        break;                       // stop reading 
      } 
      code[bytesread] = val;         // add the digit           
      bytesread++;                   // ready to read next digit  
    } 

    if(bytesread == 10)
    {  // if 10 digit read is complete 
      if (!strncmp(code, card1, 10) || !strncmp(code, card2, 10) || !strncmp(code, card3, 10)) {
        doorOpen();
      }
    }
  }
  bytesread = 0; 
  delay(500);                       // wait for a second
  button = analogRead(switchPin);
  if (!(button == 0)) {
    doorOpen();
  }
  Serial.println(button);
} 


void doorOpen() {
  //Serial.println("Valid card.");
  beep();
  digitalWrite(doorPin, HIGH);
  delay(1000);
  digitalWrite(doorPin, LOW);
}

void beep() {
  int i;
  for (i = 0; i < 2; i++) {       //TWO FAST BEEPS
    long time = millis();
    while ((millis() - time) < 50) {
      digitalWrite(piezoPin, HIGH);
      delayMicroseconds(214);
      digitalWrite(piezoPin,LOW);
      delayMicroseconds(214);
    }
    delay(50);
  }
}

For some reason with this setup, I can’t read from pins with the reader connected… When I unplug the RFID reader everything is go; I can use the switch to open the door (solenoid). When it is put back in, however, I get nothing…

Any pointers at all would be greatly appreciated, thank you!

EDIT: facepalm I know better, I swear: I’ve built this on an RBBB. The pin utilization is as-noted in the code.