Arduino Uno + RN-41 Bluetooth does not print to terminal

Hi there,

I'm working on a project where I need to control some LEDs using an Arduino via a Bluetooth connection. I'm using the RN-41 Bluetooth module and the Arduino Uno, as well as the Putty serial terminal emulator to send input to the Bluetooth that's connected to the Arduino.

I found the test code below on the internet to test whether the connection between the computer and the Bluetooth and Arduino is working. It turns on and off the on-board LED on the Arduino when you enter 1 or 0 into the putty terminal, respectively. The problem is, this code is also supposed to print a message to the terminal every time I enter 1 or 0 to turn on/off the LED, but it does not print anything to the terminal. In putty, local echo is "forced on" so any input I enter shows up on the screen. I'm not sure if there's some sort of similar setting that makes the print statements show up. Any idea what I'm doing wrong? All help and suggestions are greatly appreciated!

My code:

/*
simple LED test
*/

char val;         // variable to receive data from the serial port
int ledpin = 13;  // LED connected to pin 2 (on-board LED)

void setup()
{
  pinMode(ledpin, OUTPUT);  // pin 13 (on-board LED) as OUTPUT
  Serial.begin(9600);       // start serial communication at 115200bps

  Serial.println("Goodnight moon!"); // testing the printing function
 
}
 
void loop() {
  if( Serial.available() )       // if data is available to read
  {
    val = Serial.read();       // read it and store it in 'val'
  }
 
  if( val == '0' )               // if '0' was received led 13 is switched off

  {
    digitalWrite(ledpin, LOW);    // turn Off pin 13 off
    delay(500);                  // waits for half a second   
    Serial.println("13 off");
  }

  if( val == '1' )               // if '1' was received led 13 on
  {
    digitalWrite(ledpin = 13, HIGH);  // turn ON pin 13 on
    delay(500);                  // waits for half a second
    Serial.println("13 on");
  }
}