basic sketch

Hey guys i need some help i'm trying to figure out a basic sketch so when i send a signal from my phone through my BLE shield it will trigger pin 13 on my Uno high and low turning on the led. with a blank sketch loaded I am able to send a string from my android ssp app and see it on a serial monitor through my computer. The issue i'm having tho is any time I upload any kind of other sketch my strings don't seams to be coming through. Any kind of help would be greatly appreciated.

with a blank sketch loaded I am able to send a string from my android ssp app and see it on a serial monitor through my computer.

So, the data is getting to the hardware serial pins, and from there to the serial-to0-USB converter, and from there to the PC.

What kind of data are you sending? What are you seeing in the serial monitor?

The issue i'm having tho is any time I upload any kind of other sketch my strings don't seams to be coming through.

So, if you load the blink example, that interferes with the BLE communications? Is that what you are saying?

With a blank sketch, any character i send from my phone with show up on the serial monitor. If i send the letter K a K will show on the serial monitor. When i upload a blink sketch nothing will show on the monitor when i send it. Ive tried to modify the sketch to open the serial connection to read the letter 'O' lets say, to turn on the led nothing is showing on the serial monitor. The led just blinks. The big picture is i want to turn pin 13 led on and off with a character sent from my phone. Thats for replying

I can't see anything in the blink sketch that does anything with the serial port. So, I can't explain why sending data to the serial pins, and from there to the serial-to-USB converter would be interfered with.

Why not connect the bluetooth device to other pins, use SoftwareSerial to talk to it, and use the hardware serial instance (Serial) to debug the code?

OK maybe this will help me explain better here is the basic code I have now.

// The onboard LED is on pin # 13
int onboardLED = 13;

void setup() {
  // Begin Serial communication
  Serial.begin(9600);


  //Set the onboard LED to OUTPUT
  pinMode(onboardLED, OUTPUT);
}

void loop() {
  // Read serial port, if the number is 0 turn off LED, if the number is 1 or greater, turn the LED on.

  while (Serial.available() > 0) {
    int num = Serial.read() - '0';
    if (num < 1) {
      digitalWrite(onboardLED, LOW); //Turn Off LED
    } else {
      digitalWrite(onboardLED, HIGH); //Turn On LED
    }
  }
}

I can turn the LED on and off when I use the serial monitor from my computer. When I try to send it from my phone using my BLE shield i get nothing from the LED. Any other time I will be able to read what is sent from my phone except for when this is loaded. I just cant figure out why.

so i figured out if i take the Serial.begin(9600); line out i'm able to send strings from my phone and they will show up on the arduino serial monitor. dose this mean i may have the jumper pins on the blue-tooth shield in the wrong spot or is something else off

Google Arduino + bluetooth + LED. There are a lot of guides online that can help.

I think it would be helpful to understand serial communication a little more, take a look at the serial basics post at http://forum.arduino.cc/index.php?topic=288234.0

Turning a LED on and off with an Arduino, a HC-06 and Android | Martyn Currey may help and also help.