Andreas
07-23-2005, 10:50 PM
I realy need your help. I want to take my value from my SerString1 and put·it in my "SEROUT 15, ServoBaud+$8000,["!SC", 11, 1, pw.LOWBYTE, pw.HIGHBYTE,CR]" as "pw". How do I make this work? I can see the value correct in "SEROUT Port,Baud,[" NR1: ", STR SerString1]
" but when I try to "convert" it into "pw.LOWBYTE and pw.HIGHBYTE its not working anymore. Can you please help me=
' {$STAMP BS2}
' {$PBASIC 2.5}
pw VAR Word
ServoBaud CON 396
Baud CON 16780
Port CON 16
SerString1 VAR Byte(6)
SerString1(9)=0
SerString2 VAR Byte(6)
SerString2(9)=0
SerString3 VAR Byte(6)
SerString3(9)=0
SEROUT Port, Baud, ["Welcome"]
GOSUB sound_0:
PAUSE 100
Main:
SERIN Port,Baud,Main,2000,Main, [WAIT ("coord"), STR SerString1\5\"*", STR SerString2\5\"*", STR SerString3\5\"*"]
'PAUSE 100
SEROUT Port,Baud,[" NR1: ", STR SerString1]
SEROUT Port,Baud,[" NR2: ", STR SerString2]
SEROUT Port,Baud,[" NR3: ", STR SerString3]
PAUSE 1000
'Servo1
SEROUT 15, ServoBaud+$8000,["!SC", 11, 1, pw.LOWBYTE, pw.HIGHBYTE,CR]
GOTO Main
sound_0:
········ FREQOUT spkr,1000,2000
RETURN
" but when I try to "convert" it into "pw.LOWBYTE and pw.HIGHBYTE its not working anymore. Can you please help me=
' {$STAMP BS2}
' {$PBASIC 2.5}
pw VAR Word
ServoBaud CON 396
Baud CON 16780
Port CON 16
SerString1 VAR Byte(6)
SerString1(9)=0
SerString2 VAR Byte(6)
SerString2(9)=0
SerString3 VAR Byte(6)
SerString3(9)=0
SEROUT Port, Baud, ["Welcome"]
GOSUB sound_0:
PAUSE 100
Main:
SERIN Port,Baud,Main,2000,Main, [WAIT ("coord"), STR SerString1\5\"*", STR SerString2\5\"*", STR SerString3\5\"*"]
'PAUSE 100
SEROUT Port,Baud,[" NR1: ", STR SerString1]
SEROUT Port,Baud,[" NR2: ", STR SerString2]
SEROUT Port,Baud,[" NR3: ", STR SerString3]
PAUSE 1000
'Servo1
SEROUT 15, ServoBaud+$8000,["!SC", 11, 1, pw.LOWBYTE, pw.HIGHBYTE,CR]
GOTO Main
sound_0:
········ FREQOUT spkr,1000,2000
RETURN