Help with arduino's serial data

Hello,
I have connected a blue smirf modem on the rx and tx pins of the arduino, and i want it to do certain actions on receiving certain data at its serial port via blue smirf, but whenever i try to send data like “1” or “2”, , it always comes in the form of 3 lines of data ,eg:
when i send 1 to arduino via bluetooth, it’s serial port reads:
111
49
19
for 2:
112
50
19
for 3:
113
51
19
and so on…so how can i write a code for arduino such that when “1” is sent , it should perform one action , when “2” is sent,another action,etc.
Please help, really desperate.

What do you have for code now? Lets work from there.

You could have something like:

if (Serial.available()>2){  // three bytes came in
value1 = Serial.read();  // read the byte
value2 = Serial.read();  // read the byte
value3 = Serial.read();  // read the byte

// Go check out www.asciitable.com and see what is coming on.
// am guessing value2 will be the 'character' you really want,
// as value 3 is the same, and value 1 seems oddly incremental
// yet not in the range for 0,1,2,3,4,5,6,7,8,9

switch (value2){  // select an action
case '0':
// code for '0'
break;
case '1':
//code for '1'
break;
// etc

} end switch
} end if available

Have a look at an ASCII table

49 = '1' 50 = '2' 51 = '3'

the other number don't make much sense but they are consistent.

Show us your code.


Rob

Thanks a lot,really helped.