PBasic 2.5 Documentation
Archiver
Posts: 46,084
Does anybody out there in StampLand know where the download for
PBasic 2.5 documentation is?
Does anybody out there know how the (xmG.Bit15 * 13 + "") expression works in
the
below line of code (xmG is a WORD-sized variable; this code was taken from the
Memsic 2125 accelerometer demo Experiment 1, and I'm pretty sure it delivers a
space or a minus sign, based on the msb of the xmG variable)
DEBUG "G Force... ", (xmG.Bit15 * 13 + " "),DEC (ABS xmG / 1000),
".", DEC3 (ABS xmG), " g",
PBasic 2.5 documentation is?
Does anybody out there know how the (xmG.Bit15 * 13 + "") expression works in
the
below line of code (xmG is a WORD-sized variable; this code was taken from the
Memsic 2125 accelerometer demo Experiment 1, and I'm pretty sure it delivers a
space or a minus sign, based on the msb of the xmG variable)
DEBUG "G Force... ", (xmG.Bit15 * 13 + " "),DEC (ABS xmG / 1000),
".", DEC3 (ABS xmG), " g",
Comments
>PBasic 2.5 documentation is?
>
>Does anybody out there know how the (xmG.Bit15 * 13 + "") expression
>works in the
>below line of code (xmG is a WORD-sized variable; this code was taken from the
>Memsic 2125 accelerometer demo Experiment 1, and I'm pretty sure it delivers a
>space or a minus sign, based on the msb of the xmG variable)
>
>DEBUG "G Force... ", (xmG.Bit15 * 13 + " "),DEC (ABS xmG / 1000),
>".", DEC3 (ABS xmG), " g",
I'm sure Jon or Erik will jump in and correct me if I'm wrong, but
according to the web site the documentation is scheduled for release
in late June or early July. (That is the wonderful thing about beta
releases--you get to figure out their fine features by yourself or by
asking questions!)
(xmG.Bit15 * 13 + " ")
or you could write that:
(xmG.Bit15 * 13 + 32)
bit15 is the sign of the number in twos-complement form, one for
negative, zero for positive. So, multiply the sign bit times 13, you
either get 13 or zero. Space is ascii 32. So the result of the
whole thing is either 13+32=45 for negative, which is the minus sign,
or 32 for positive, which is the space.
I usually use get the the following way:
(rep "-"\xmG.Bit15)
or
(rep 45\xmG.Bit15)
The REP modifier (REPeat) is very useful in the Stamp serial output
repertoire. This prints the minus sign, or not, depending on the
sign bit.
I would'a spent a week trying to figure that one out. After you see
it, like so many other things, it becomes obvious (How could ANYBODY
not know that?)
Mark
On Saturday, May 31, 2003, at 04:20 PM, Tracy Allen wrote:
>> Does anybody out there in StampLand know where the download for
>> PBasic 2.5 documentation is?
>>
>> Does anybody out there know how the (xmG.Bit15 * 13 + "") expression
>> works in the
>> below line of code (xmG is a WORD-sized variable; this code was taken
>> from the
>> Memsic 2125 accelerometer demo Experiment 1, and I'm pretty sure it
>> delivers a
>> space or a minus sign, based on the msb of the xmG variable)
>>
>> DEBUG "G Force... ", (xmG.Bit15 * 13 + " "),DEC (ABS xmG / 1000),
>> ".", DEC3 (ABS xmG), " g",
>
> I'm sure Jon or Erik will jump in and correct me if I'm wrong, but
> according to the web site the documentation is scheduled for release
> in late June or early July. (That is the wonderful thing about beta
> releases--you get to figure out their fine features by yourself or by
> asking questions!)
>
>
> (xmG.Bit15 * 13 + " ")
> or you could write that:
> (xmG.Bit15 * 13 + 32)
> bit15 is the sign of the number in twos-complement form, one for
> negative, zero for positive. So, multiply the sign bit times 13, you
> either get 13 or zero. Space is ascii 32. So the result of the
> whole thing is either 13+32=45 for negative, which is the minus sign,
> or 32 for positive, which is the space.
>
> I usually use get the the following way:
> (rep "-"\xmG.Bit15)
> or
> (rep 45\xmG.Bit15)
> The REP modifier (REPeat) is very useful in the Stamp serial output
> repertoire. This prints the minus sign, or not, depending on the
> sign bit.
>
> 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.
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
>
a couple of PDFs that specifically cover language and compiler updates. It
will take us a few months to revise the other documentation after the final
editor is released. Be sure to install the Beta 2 editor that we just released
this week so you have the latest information.
That said, the code that you indicate is valid in PBASIC 2.0 syntax.
And you are right, the code you question below is designed to print either a
minus sign or a space in the DEBUG terminal. The reason for using this
(versus SDEC) is that division does not work with negative (two's compliment)
numbers in PBASIC.
-- Jon Williams
-- Parallax
In a message dated 5/31/2003 2:45:43 PM Central Standard Time,
marpetm@s... writes:
> Does anybody out there in StampLand know where the download for
> PBasic 2.5 documentation is?
>
> Does anybody out there know how the (xmG.Bit15 * 13 + "") expression works
> in the
> below line of code (xmG is a WORD-sized variable; this code was taken from
> the
> Memsic 2125 accelerometer demo Experiment 1, and I'm pretty sure it delivers
> a
> space or a minus sign, based on the msb of the xmG variable)
>
> DEBUG "G Force... ", (xmG.Bit15 * 13 + " "),DEC (ABS xmG / 1000),
> ".", DEC3 (ABS xmG), " g",
[noparse][[/noparse]Non-text portions of this message have been removed]
version that prints either the space or minus sign keeps all the numbers
left-aligned.
-- Jon
In a message dated 5/31/2003 3:22:50 PM Central Standard Time,
tracy@e... writes:
> I usually use get the the following way:
> (rep "-"\xmG.Bit15)
[noparse][[/noparse]Non-text portions of this message have been removed]
I can't get any on-line documentation after installing the beta2
version.
In beta1 the HELP function gets me the Syntax Guide; HELP is grayed
out in beta2.
Is this the doc that should install with the new editor? What am I
doing wrong?
Marylou
________________________________________________
--- In basicstamps@yahoogroups.com, jonwms@a... wrote:
> The documentation installs with the new editor in the form of a
help file and
> a couple of PDFs that specifically cover language and compiler
updates. It
> will take us a few months to revise the other documentation after
the final
> editor is released. Be sure to install the Beta 2 editor that we
just released
> this week so you have the latest information.
>
> -- Jon Williams
> -- Parallax
week? If so, you should have a nice new help file (updated for PBASIC 2.5 and
many other things), as well as two PDF files that cover the new editor
interface and PBASIC 2.5 specifics.
Get the new installer here:
<A
HREF="http://www.parallax.com/html_pages/downloads/software/software_basic_stamp\
.asp">
http://www.parallax.com/html_pages/downloads/software/software_basic_stamp.asp</\
A>
-- Jon Williams
-- Parallax
In a message dated 5/31/2003 7:52:55 PM Central Standard Time,
astumpf999@y... writes:
> Jon,
>
> I can't get any on-line documentation after installing the beta2
> version.
>
> In beta1 the HELP function gets me the Syntax Guide; HELP is grayed
> out in beta2.
>
> Is this the doc that should install with the new editor? What am I
> doing wrong?
>
> Marylou
[noparse][[/noparse]Non-text portions of this message have been removed]
___________________________________
--- In basicstamps@yahoogroups.com, jonwms@a... wrote:
> Did you download and install the new Beta 2 compiler that we
released this
> week? If so, you should have a nice new help file (updated for
PBASIC 2.5 and
> many other things), as well as two PDF files that cover the new
editor
> interface and PBASIC 2.5 specifics.
>
> Get the new installer here:
>
> <A
HREF="http://www.parallax.com/html_pages/downloads/software/software_b
asic_stamp.asp">
>
http://www.parallax.com/html_pages/downloads/software/software_basic_s
tamp.asp</A>
>
> -- Jon Williams
> -- Parallax
>
> In a message dated 5/31/2003 7:52:55 PM Central Standard Time,
> astumpf999@y... writes:
>
> > Jon,
> >
> > I can't get any on-line documentation after installing the beta2
> > version.
> >
> > In beta1 the HELP function gets me the Syntax Guide; HELP is
grayed
> > out in beta2.
> >
> > Is this the doc that should install with the new editor? What am
I
> > doing wrong?
> >
> > Marylou
>
>
>
> [noparse][[/noparse]Non-text portions of this message have been removed]
Speaking of the Help File. This one has been an irritant for quite a
while:
In the HTML Help Project, would the Help Designer be so kind as to
check the box titled "Save user defined window position after first
use" (HTML Help Workshop), or "Remember window position & size"
(FAR)?
It is really irritating to have to move and resize the help window
every time it is opened. Checking that box, or setting the
appropriate window flag, will cause Windows to remember where the
*** end user *** (not the designer) positioned the window as well as
its size.
Thank You :-)
P.S.
Wanna hear my rant about the Large Fonts / Small Fonts issue? ;-)
Kenny
found that the box was unchecked. I will recompile and make sure it's available
in the final release.
Send your *rants* and any other suggestions (as requested in the
documentation) to pbasic25beta@p... -- this list is really not the place
for those
things.
-- Jon Williams
-- Parallax
In a message dated 6/1/2003 11:51:39 AM Central Standard Time,
gapdev@y... writes:
> >>you should have a nice new help file
>
> Speaking of the Help File. This one has been an irritant for quite a
> while:
>
> In the HTML Help Project, would the Help Designer be so kind as to
> check the box titled "Save user defined window position after first
> use" (HTML Help Workshop), or "Remember window position &size"
> (FAR)?
>
> It is really irritating to have to move and resize the help window
> every time it is opened. Checking that box, or setting the
> appropriate window flag, will cause Windows to remember where the
> *** end user *** (not the designer) positioned the window as well as
> its size.
>
> Thank You :-)
>
> P.S.
> Wanna hear my rant about the Large Fonts / Small Fonts issue? ;-)
>
> Kenny
[noparse][[/noparse]Non-text portions of this message have been removed]