OK, THIS IS THE WHOLE CODE:
on the stamp:
' {$STAMP BS2}
' {$PBASIC 2.5}
' {$PORT COM1}
dat VAR Byte
DO
SEROUT 10, 396, ["blink"]
SERIN 10, 396, [WAIT("t"), dat]
DEBUG "data: ", DEC dat, CR
PAUSE 1000
LOOP
on the pic:
define OSC 20
INCLUDE "modedefs.bas"
S_in var PORTC.0
S_Out var PORTC.0
Led var PORTC.3
dat var byte
Main:
SerIn2 S_in,396,[dat]
gosub blink
SEROUT s_out, T2400,["1234t", dat]
pause 50
goto main
Blink:
high led
pause 10
low led
return
THAT code only returns me "data: 0" in my debug window (witch is already strange.)
and if i use THIS code (the one i actually need):
on the stamp:
' {$STAMP BS2}
' {$PBASIC 2.5}
' {$PORT COM1}
dat VAR Byte
DO
SEROUT 10, 396, ["blink"]
DEBUG "data: ", DEC dat, CR
PAUSE 1000
LOOP
on the pic:
define OSC 20
INCLUDE "modedefs.bas"
S_in var PORTC.0
S_Out var PORTC.0
Led var PORTC.3
dat var byte
Main:
SerIn2 S_in,396,[wait("k")]
gosub blink
pause 50
goto main
Blink:
high led
pause 10
low led
return
than it never blinks and never sees a "k". I really need this problem solved. please post ANYTHING that might help me (i live in european time so i usely have to wait a whole night before i can read your answers and an other day before you read my posts, so post anything you got, i don't have much time left) and my config is HS (in winpic) and define OSC = 20. "dat" is the byte in witch it saves the data received from serin2, isn't it?
thanks in advance,
Chris
Bookmarks