Reading Numbers?
So I am trying to read numbers that I have sent from a basic stamp to the propeller.
From the basic stamp:
To the propeller:
I want to send and read 1,2,3,4,5,6........
But it is only sending ASCII for the hundreds place digit
From the basic stamp:
' {$STAMP BS2}
' {$PBASIC 2.5}
x VAR Word
x=0
DO
SEROUT 15,84, ["L"]
PAUSE 150
SEROUT 15,84, [DEC x]
x=x+1
DEBUG ? x
LOOP
To the propeller:
_CLKMODE = XTAL1 + PLL16X 'Adjust the frequency
Baud = 9600
polarity = 0
bits = 8
OBJ
bs : "BS2_Functions" 'Basic Stamp 2 library
VAR
long number
byte letter
pub Main
bs.start(0,30)
repeat
letter := bs.serin_char(0, Baud, 1, 8)
bs.DEBUG_CHAR(letter)
if letter := "L"
number := bs.serin_char(0, Baud, 1, bits)
bs.serout_dec(30, number, Baud, 1, 8)
bs.Debug_Char(13)
waitcnt(clkfreq/4 + cnt)
I want to send and read 1,2,3,4,5,6........
But it is only sending ASCII for the hundreds place digit

Comments
val := 0 repeat bs.serin_char(whatever) if char => "0" and char =< "9" 'it's a number var *= 10 var += char - "0" else 'val is received number