Bluetooth module serial problems

Hi all,

I bought a simple serial bluetooth module for my arduino mega, and I am sending it information from a processing sketch on my PC. I am able to get an LED to blink using this code.

char val;
int pin = 13;

void setup() {
   Serial.begin(9600);
   pinMode(pin, OUTPUT);
}

void loop() {
   while(Serial.available()){
    char inChar = (char)Serial.read(); 
    switch(inChar){
       case '1': digitalWrite(pin, HIGH);
          break;
       case '0': digitalWrite(pin, LOW);
          break;
    }
    Serial.println(inChar);    
   } 
}

however, when I switch the pins to Serial1 and use this code the LED doesn'd blink

char val;
int pin = 13;

void setup() {
   Serial1.begin(9600);
   pinMode(pin, OUTPUT);
}

void loop() {
   while(Serial1.available()){
    char inChar = (char)Serial1.read(); 
    switch(inChar){
       case '1': digitalWrite(pin, HIGH);
          break;
       case '0': digitalWrite(pin, LOW);
          break;
    }
    Serial.println(inChar);    
   } 
}

My processing sketch just alternates between sending a 1 and 0 to the module as chars

import processing.serial.*;
Serial myPort;

//String val;
//int high = 1;
//int low = 0;

void setup(){
 
  printArray(Serial.list());  //list of serial ports
  myPort = new Serial(this, Serial.list()[1], 9600); //the port with the module
  
}

void draw(){
     myPort.write('1');
     delay(1000);
     myPort.write('0');
     delay(1000);
}