Serial strings and variables
Archiver
Posts: 46,084
I want to change the Speakjet chip's oscillator's frequency value
using a sensor and Basic stamp 2. So I need to send it variables and
strings, because the SCP (serial control protocol) of the speakjet
chip needs values and letters (ex: 1J500N is oscillator 1 at 500Hz).
Sending one after the other doesn't work:
SEROUT 15,$0054,[noparse][[/noparse]"\08J0N1J"]
SEROUT 15,$0054,[noparse][[/noparse]result]
SEROUT 15,$0054,[noparse][[/noparse]"N"]
and sending both at once doesn't either:
SEROUT 15,$0054,[noparse][[/noparse]result,"N"]
Has anybody done something dynamic with BS2 and speakjet's SCP ?? Or
am I not understanding something with Pbasic 2.5?
using a sensor and Basic stamp 2. So I need to send it variables and
strings, because the SCP (serial control protocol) of the speakjet
chip needs values and letters (ex: 1J500N is oscillator 1 at 500Hz).
Sending one after the other doesn't work:
SEROUT 15,$0054,[noparse][[/noparse]"\08J0N1J"]
SEROUT 15,$0054,[noparse][[/noparse]result]
SEROUT 15,$0054,[noparse][[/noparse]"N"]
and sending both at once doesn't either:
SEROUT 15,$0054,[noparse][[/noparse]result,"N"]
Has anybody done something dynamic with BS2 and speakjet's SCP ?? Or
am I not understanding something with Pbasic 2.5?
Comments
> I want to change the Speakjet chip's oscillator's frequency value
> using a sensor and Basic stamp 2. So I need to send it variables
and
> strings, because the SCP (serial control protocol) of the speakjet
> chip needs values and letters (ex: 1J500N is oscillator 1 at
500Hz).
> Sending one after the other doesn't work:
> SEROUT 15,$0054,[noparse][[/noparse]"\08J0N1J"]
> SEROUT 15,$0054,[noparse][[/noparse]result]
> SEROUT 15,$0054,[noparse][[/noparse]"N"]
> and sending both at once doesn't either:
> SEROUT 15,$0054,[noparse][[/noparse]result,"N"]
>
> Has anybody done something dynamic with BS2 and speakjet's SCP ??
Or
> am I not understanding something with Pbasic 2.5?
What about:
SEROUT 15,$0054,[noparse][[/noparse]DEC result]
I guess 'result' is a variable, and you want to send it in numeric
value? Then use DEC or DEC2 if it's two digits or DEC3 or DEC4 (max
four digits)
SEROUT 15, $0054, [noparse][[/noparse]DEC result]
-- Jon Williams
-- Applications Engineer, Parallax
-- Dallas Office
Original Message
From: bobtoton [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=cyWrGwtw9FxXaUxPZUKZ4nMdczh7VEwggfE8KRdC7eeLJmtk3EdaCAci1TDDFMoX2UjUQSMXrX3mUz1YoYu3Hw]hugodini@w...[/url
Sent: Monday, March 22, 2004 3:20 PM
To: basicstamps@yahoogroups.com
Subject: [noparse][[/noparse]basicstamps] Serial strings and variables
I want to change the Speakjet chip's oscillator's frequency value
using a sensor and Basic stamp 2. So I need to send it variables and
strings, because the SCP (serial control protocol) of the speakjet
chip needs values and letters (ex: 1J500N is oscillator 1 at 500Hz).
Sending one after the other doesn't work:
SEROUT 15,$0054,[noparse][[/noparse]"\08J0N1J"]
SEROUT 15,$0054,[noparse][[/noparse]result]
SEROUT 15,$0054,[noparse][[/noparse]"N"]
and sending both at once doesn't either:
SEROUT 15,$0054,[noparse][[/noparse]result,"N"]
Has anybody done something dynamic with BS2 and speakjet's SCP ?? Or
am I not understanding something with Pbasic 2.5?
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject
and Body of the message will be ignored.
Yahoo! Groups Links
This message has been scanned by WebShield. Please report SPAM to
abuse@p....